[email protected] wrote on 1/14/10 5:53 PM:
Author: marvin
Date: Thu Jan 14 23:53:22 2010
New Revision: 899480

URL: http://svn.apache.org/viewvc?rev=899480&view=rev
Log:
Always build under C99 with GCC.


*sigh*

perhaps this was premature on my part. Now I'm getting failures to compile under Linux, CentOS 5 32bit and RHEL 4 64bit both tested, with gcc 4.1.2 and 3.4.6. With -std=c99 I get errors like:

../core/KinoSearch/Store/FSFolder.c: In function ‘S_dir_ok’:
../core/KinoSearch/Store/FSFolder.c:292: error: ‘S_IFDIR’ undeclared (first use in this function)

and

../core/KinoSearch/Store/FSDirHandle.c: In function ‘kino_FSDH_entry_is_dir’:
../core/KinoSearch/Store/FSDirHandle.c:104: error: ‘DT_DIR’ undeclared (first use in this function)



but with no -std=c99 it compiles just fine.

I googled and poked around the code and am just puzzled. The errors indicate that some .h is not being properly included, but the code itself has #ifdef CHY_HAS_* tests around it, indicating that Charmonizer found the .h just fine. And yes, Charmonizer compiles ok with the -std=c99 option.

Weird.

Same holds true for KS 0.30_072 -- I just tried it with -std=c99 and it fails to compile with same error:

core/KinoSearch/Util/Compat/DirManip.c: In function ‘kino_DirManip_dir_ok’:
core/KinoSearch/Util/Compat/DirManip.c:36: error: ‘S_IFDIR’ undeclared (first use in this function)

core/KinoSearch/Util/Compat/DirManip.c: In function ‘SI_entry_is_dir’:
core/KinoSearch/Util/Compat/DirManip.c:101: error: ‘DT_DIR’ undeclared (first use in this function)

I tried it with KINO_DEBUG=1 as well under CentOS5 (gcc 4.1.2) which includes -std=c89 and it failed with same error.

So OS X is happy only with c99 and Linux is happy only without it.

thoughts?
--
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to