On Wed, 2009-04-29 at 13:24 -0500, Dick Hollenbeck wrote:
[snip]
> The C99 stuff is purely arbitrary IMO, there is almost always another 
> way to code those things.   And rather than ifdef-ing them out, I would 
> simply find that other way and offer those changes as patches, removing 
> the C99 support altogether if this is really worth your time.

We are talking about removing support for a standard that is supported
by most modern compilers, in order to support an old compiler on one
platform, right?  If anything, I think the code should be moving in the
opposite direction.  I would like to see us embrace using C99 features,
abandoning support for compilers unable to support a standard that is
now a decade old.  

>From what I can tell based on feedback to the list, the majority -- if
not all -- of developers are using GCC to build OpenOCD.  That does not
mean we should support GCC only, but it does suggest that we should work
on moving forward -- not back.  MSVC is the first problematic complier
that I have seen reported, and members of the community already have
working CygWin and MinGW32 builds.

While I do not want to prejudge without first seeing a patch, there are
numerous idiomatic expressions required to preserve compatibility with
old compilers, which I believe detract from the readability of the code.
I mean, is it really necessary to continue to place variables at the
start of a block?  Would it be so wrong to declare iterator variables in
for loops to limit their available scope?  Aside from MSVC, are there
really other compilers in use here that will not accept such code?

This group has talked about using trying to use C++ features; why not
simply start by adopting C99 features?  I would not consider using the
former language without a complete rewrite, but my recent spate of
cleaning for C99 seems to have been well received by community. Treating
errors as warnings has not exposed irreconcilable problems from what I
can tell.  OpenOCD appears to be ready to move to C99 today, why give
that up?  Note: I am not suggesting we use all C99 features like inline
functions or even variable-length arrays, just avoid moving backwards.

Due to the lack of prior opposition, I had been debating whether to
simply commit a change that adds -std=c99 and seeing how the community
reacts (since I can now revert it quickly if it poses a real problem). 
As there has been a lot going on, I was trying to avoid the distraction
of this debate, but this thread prompts more immediate consideration.

Cheers,

Zach

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to