Wireshark-dev: Re: [Wireshark-dev] Move from C89 to C99?
From: Andrew Hood <ajhood@xxxxxxxxx>
Date: Tue, 19 Jan 2010 08:04:08 +1100
Guy Harris wrote:
> On Jan 18, 2010, at 8:03 AM, Joerg Mayer wrote:
> 
> 
>>with Wireshark being more than 10 years old and e.g. requiring glib2/gtk2,
>>maybe it would be OK to move the coding requirements from C89 to C99.
>>This would give us // comments, inline keywords and the like.
>>
>>What do you think?
> 
> 
> I think the main compiler that has problems with // comments is the IBM C compiler for AIX, and, at least in newer versions, I think there might be a compiler flag to enable them; we'd have to have the configure script and the CMake stuff enable that flag when compiling with not-GCC on AIX.  I don't know whether any other compilers reject them by default.
> 
> I don't know which other features of C99 aren't handled by, for example, MSVC++; we should check that.
> 
> Some C99 functions are implemented in header files or the C library; there might be systems that don't implement those features.
> 
> Whatever useful C99 features we *can* adopt, we probably should.

Every time someone asks "can we move from C89 to C99" I ask why?

Is there some C99 feature required and without which no further
development is possible?

Is it just so lazy programmers can use C99 comments and declare variable
at random places in the code?

As Guy suggests, there are still C compliers around which are not C99
compliant and which we can not upgrade.

I ran across something the other day (not Wireshark) which after
configure tested for C99 compliance and not finding it still tried to
compile some C99 only code. Fortunately I've figured out how to fix
these programmer errors.

-- 
There's no point in being grown up if you can't be childish sometimes.
                -- Dr. Who