"Klaus T. Aehlig" <aeh...@linta.de> writes: [...] > #include <sys/types.h> > #include <unistd.h> > int > main () > { > off_t u; long v; &u==&v; > ; > return 0; > } > > and check for compile errors. However, the above program is rejected > by clang, as the value &u==&v is unused, which, of course, has nothing > to do with the intended check whether off_t * and long * are compatible > pointer. > > Adding > > CFLAGS+= -Wno-unused > > solves this problem.
Alternatively, you can turn off only a specific -Werror, e.g. CFLAGS += -Wno-error=unused it's ignored by gcc in base while gcc46 wants -Wno-error=unused-value $ gcc -Wunused -Werror -Wno-error=unused test.c cc1: warnings being treated as errors test.c: In function 'main': test.c:6: warning: statement with no effect Exit 1 $ gcc46 -Wunused -Werror -Wno-error=unused-value test.c test.c: In function 'main': test.c:6:18: warning: statement with no effect [-Wunused-value] $ clang -Wunused -Werror -Wno-error=unused test.c test.c:6:20: warning: expression result unused [-Wunused-value] off_t u; long v; &u==&v; ~~^ ~~ 1 warning generated. _______________________________________________ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"