[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xmlblaster] compiling c-lib on freebsd

here's a quick follow up patch.

this fixes the inline warnings for gcc. as per

The keywords asm, typeof and inline are not available in programs compiled
with -ansi or -std (although inline can be used in a program compiled with
-std=c99). The ISO C99 keyword restrict is only available when -std=gnu99
(which will eventually be the default) or -std=c99 (or the equivalent
-std=iso9899:1999) is used.

The way to solve these problems is to put __ at the beginning and end of
each problematical keyword. For example, use __asm__ instead of asm, and
__inline__ instead of inline. 

I can't figure out what the right macro is for determining if =std=c99 has
been passed tho.

also, the order of includes for freebsd was incorrect.  sys/types.h must
come first.


-----Original Message-----
From: Marcel Ruff [mailto:mr at marcelruff.info] 
Sent: Friday, November 19, 2004 12:03 AM
To: xmlblaster at server.xmlblaster.org
Subject: Re: [xmlblaster] compiling c-lib on freebsd

Viner, David wrote:
> this patch allows c-lib (with SOCKET enabled) to compile on FreeBSD using
> gcc-2.95.3.  the only remaining warnings are:
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/helper.c:575:
> warning: ANSI does not permit the keyword `
> inline'
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/helper.c: In
> function `int64ToStr':
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/helper.c:643:
> warning: ANSI C does not support the `ll' l
> ength modifier
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/helper.c: In
> function `strToInt64':
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/helper.c:660:
> warning: ANSI C does not support the `ll' l
> ength modifier
>        [cc]
> /home/dviner/mom/xb-svn/xmlBlaster/build.tmp/src/c/util/msgUtil.c:196:
> warning: ANSI does not permit the keyword
> `inline'
> I'm not sure how to remove these warnings, but turning off -pedantic.
> The src/c/socket/xmlBlasterSocket.h file had a ton of windows-style
> which caused lots of warnings to be issued on my machine.  so, I ran
> dos2unix on it, which is why it appears that there are a lot of changes to
> it.  in fact, the only significant addition is:
> 	#  include <sys/types.h>
> before the inclusion of <sys/socket.h>.  This is required on FreeBSD, and
> likely won't hurt any other Unix platforms.
> Thanks
> dave

thank you for this patch, it is now commited to subversion and
available online.
Your patch is handled under LGPL (or any coming more free license like
Apache or BSD)
it this is OK for you.

The inline warning:
  Do you now how to ask the compiler if it wants C99 or an older variant?
  If such a define is available we could set it in basicDefs.h to something

   #  if __standard_C__ >= C99    /* How to check this ??? */
   #    define _INLINE_FUNC inline
   #  else
   #    define _INLINE_FUNC
   #  endif

Using of 64 bit long long:

We need a 64 bit long, so if a compiler does not support it
there is currently no workaround implemented.

Anyhow, you should tell your gcc to compile as C99 and the warnings should
even with -pedantic,




Attachment: patch2.patch
Description: Binary data