Is the MapServer code supposed to be ANSI C?

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Tue Feb 1 12:00:53 EST 2005


Agreed.  We might want to add -ansi -pedantic to our compile settings in
Makefile as well.

..Tom


> -----Original Message-----
> From: UMN MapServer Developers List 
> [mailto:MAPSERVER-DEV at LISTS.UMN.EDU] On Behalf Of Steve Lime
> Sent: Tuesday, 01 February, 2005 11:51
> To: MAPSERVER-DEV at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-DEV] Is the MapServer code 
> supposed to be ANSI C?
> 
> 
> Hi Petter: Certainly intended to send to the whole list, slip 
> of the mouse (CC'ing now). After doing a bit of reading after 
> your initial posting I agree that that ANSI C C89 makes the 
> most logical target at this point in time.
> 
> Steve
> 
> >>> Petter Reinholdtsen <pere at hungry.com> 01/31/05 4:23 PM >>>
> 
> [Steve Lime]
> > Petter: A target has never really been discussed. I think many 
> > developers took some of their cues (stylewise) from my 
> original code, 
> > which in some places may be 7 or 8 years old (not too much of that 
> > left, but there is some). I shot for ANSI C but never 
> explicitly set 
> > that as a design goal.
> 
> Well, unless one agrees on the specification, it is hard to 
> know if the code is correct or not.  Given a specification, 
> one can decide if the code or the compiler behaves correctly. 
>  Without a specification, it is much harder.
> 
> And the question about C89 or C99 have practical 
> implications.  Should code like this be allowed:
> 
>   int foo; // C99 comment, illegal in C89.
>   char a[foo]; /* varsize array, illegal in C89 */
>   char c = -1; /* C89 allow both signed and unsigned char type */
>   if (c > 0) /* undefined behavior for C89, well defined for C99 */
>      printf("negative c\n");
> 
> Because of these and other issues, I would prefer to know if 
> the code is supposed to be ANSI C or not, and if it is 
> supposed to be ANSI C, which version of ANSI C it is supposed 
> to be using.
> 
> I would prefer the code to follow ANSI C using the C89 
> specification, because several of the compilers I am using 
> are not able to handle the C99 specification yet.
> 
> (Btw, why did you send your answer only to me?  I'm happy to 
> discuss this on the public list. :)
> 



More information about the mapserver-dev mailing list