Changeset 1356


Ignore:
Timestamp:
Jun 26, 2011 8:28:58 PM (2 years ago)
Author:
stefanct
Message:

make Makefile's test programs safe(r)

we don't use -W or similarly strict compiler checks (yet), but
enabling its use is a good thing. if you add -W to the cflags
without this patch, detection of the compiler will fail with gcc 4.4
for example, because compiling of the test program will fail due to
a warning of unused arguments and -Werror. similarly the other
checks involving compiling test programs would fail.

Signed-off-by: Stefan Tauner <stefan.tauner@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r1316 r1356  
    414414        @printf "Checking for a C compiler... " 
    415415        @$(shell ( echo "int main(int argc, char **argv)"; \ 
    416                    echo "{ return 0; }"; ) > .test.c ) 
     416                   echo "{ (void) argc; (void) argv; return 0; }"; ) > .test.c ) 
    417417        @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test.c -o .test$(EXEC_SUFFIX) >/dev/null &&    \ 
    418418                echo "found." || ( echo "not found."; \ 
     
    428428                   echo "struct pci_access *pacc;";        \ 
    429429                   echo "int main(int argc, char **argv)"; \ 
    430                    echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c ) 
     430                   echo "{ (void) argc; (void) argv; pacc = pci_alloc(); return 0; }"; ) > .test.c ) 
    431431        @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null 2>&1 &&           \ 
    432432                echo "found." || ( echo "not found."; echo;                     \ 
     
    470470                   echo "struct ftdi_context *ftdic = NULL;";      \ 
    471471                   echo "int main(int argc, char **argv)"; \ 
    472                    echo "{ return ftdi_init(ftdic); }"; ) > .featuretest.c ) 
     472                   echo "{ (void) argc; (void) argv; return ftdi_init(ftdic); }"; ) > .featuretest.c ) 
    473473        @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 &&     \ 
    474474                ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) ||        \ 
     
    478478                   echo "struct utsname osinfo;";          \ 
    479479                   echo "int main(int argc, char **argv)"; \ 
    480                    echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c ) 
     480                   echo "{ (void) argc; (void) argv; uname (&osinfo); return 0; }"; ) > .featuretest.c ) 
    481481        @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ 
    482482                ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) ||    \ 
     
    491491                   echo "struct utsname osinfo;";          \ 
    492492                   echo "int main(int argc, char **argv)"; \ 
    493                    echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c ) 
     493                   echo "{ (void) argc; (void) argv; uname (&osinfo); return 0; }"; ) > .featuretest.c ) 
    494494        @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ 
    495495                ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) ||    \ 
Note: See TracChangeset for help on using the changeset viewer.