clang and configure checking for equivalent simple type

Chuck Swiger cswiger at mac.com
Thu Sep 29 05:26:24 UTC 2011


Hi--

On Sep 28, 2011, at 9:58 PM, Klaus T. Aehlig wrote:
> However, I assume that these kind of tests are quite widespread in configure
> scripts, so I wonder what to do about this. Possible options include
> 
> - adding 'CFLAGS+= -Wno-unused' just for this port
> 
> - do nothing, but recommend users to have -Wno-unused in CFLAGS when using clang
>  (maybe somewhere in the handbook)
> 
> - check with portmgr@ if adding -Wno-unused to the default CFLAGS (for clang?)
>  is an option
> 
> - something completely different?? 
>  (like: add an appropriate entry to my /etc/make.conf and don't care)
> 
> Any suggestions? 

Are you sure that you don't have -Werror being set somehow?  I don't have a FreeBSD-9 system handy at the moment, but that code ought to compile under clang (with warnings, sure, but the result runs):

% clang -o t t.c
t.c:6:20: warning: comparison of distinct pointer types ('off_t *' (aka 'long long *') and 'long *')
off_t u; long v; &u==&v;
                 ~~^ ~~
t.c:6:20: warning: expression result unused [-Wunused-value]
off_t u; long v; &u==&v;
                 ~~^ ~~
2 warnings generated.
% ./t ; echo $?
0
% clang --version
Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)

Regards,
-- 
-Chuck



More information about the freebsd-ports mailing list