On Sun, Apr 3, 2011 at 1:17 AM, Xavier Chantry <chantry.xavier@gmail.com>wrote:
I am just curious, what do we need this flag for ?
I only found this : http://gcc.gnu.org/onlinedocs/gcc/Inline.html GCC implements three different semantics of declaring a function inline. One is available with -std=gnu89 or -fgnu89-inline or when gnu_inline attribute is present on all inline declarations, another when -std=c99, -std=c1x, -std=gnu99 or -std=gnu1x (without -fgnu89-inline), and the third is used when compiling C++.
There is a small annoyance with clang, the configure check believes fgnu89-inline is supported because clang only emits a warning when that flag is specified : checking for -fgnu89-inline... yes
So every libalpm file triggers this warning when building : clang: warning: argument unused during compilation: '-fgnu89-inline'
Anyway it looks like we could use -std=gnu89 alternatively ? ... which brings to another topic that was brought recently on the ML : I tried to build with that and got a lot of warnings :) ../../lib/libalpm/alpm.h:396:29: warning: commas at the end of enumerator lists are a C99-specific feature [-pedantic] pacman.c:1201:8: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement] util.c:797:8: warning: variable declaration in for loop is a C99-specific feature [-pedantic] ...
Looks like there are more warnings when using gnu89: $ make 2>&1 | grep 'warning:' | cut -d' ' -f3- | sort | uniq -c 74 comma at end of enumerator list 1 initializer element is not computable at load time 7 ISO C90 does not support the 'j' gnu_printf length modifier 106 ISO C90 does not support the 'z' gnu_printf length modifier 41 ISO C90 forbids mixed declarations and code 57 ISO C90 forbids specifying subobject to initialize