[PATCH]: "decorate" gcc extensions with __extension__
Tue Mar 29 18:53:00 GMT 2005
Corinna Vinschen wrote:
> I don't quite understand why it's necessary to build Cygwin using pedantic
In order to catch thinko's and other silly mistakes which might not
otherwise show up at regular warning levels. Even little warnings, like
comparing signed with unsigned, can lead to trouble. Being able to
identify potential problem areas is important. Catching the smaller
bugs just isn't possible at the current warning level. The difference
between the current warning level and pedantic are not just warnings for
gcc extensions alone. Since I assume you and Chris are quite familiar
with gcc, I will not waste your time by going into detail regarding what
all pedantic covers. The bottom line is that giving the developer the
ability to compile at that level can provide one more opportunity to
catch a bug before it manifests itself.
> Cygwin is certainly never meant to be built in pedantic mode
I'm sorry you feel this way, but I think that it is a bad attitude.
Pedantic mode exposes many warnings which are useful, but not present in
-Wall. The only reason it isn't meant to build at that level is because
nobody has taken the time to go through and address the minor issues
which cause it to fail building at that level.
> and it's an annoying mess to have to care for this all the time instead of fixing the
> real problems.
Give me a break, the work is already done (by me). This is no more
difficult to maintain then any other attribute flags. You set it and
forget it. Remove it when you remove the statement, it doesn't get
easier then that. I'm not asking you to do the work of identifying
issues which do not allow compiling at pedantic mode, I've already done
that. I know there is much to be done in terms of work on Cygwin, but
as I've mentioned before, I think allowing a higher warning level is
useful for catching minor bugs which might otherwise go unnoticed. You
make it seem as if the warnings produced are irrelevant, which is a
rather dangerous assumption.
I might point out that GCC extensions aren't necessarily bad, which is
why I opted to tag and not to change them. I do not consider them
"bugs" which I do not want to fix. My point was that they weren't
standard and had potential for abuse if not used correctly and that
later on down the line, alternatives should be considered.
> If you personally have fun to build Cygwin in pedantic mode,
> go ahead,
It isn't a matter of "fun", it's a matter of correctness. I'll admit
that fixing whitespace and code style isn't glamorous, but it has to be
done sooner or later. Many other projects have janitors, such as the
Linux Kernel, so why not Cygwin?
> but don't expect that the whole code will be changed to support
I'm note trying to be inflammatory, but that is a totally asinine
statement. My changes are:
1) Very low maintenance.
3) Average 1 - 2 lines in most cases.
I hardly think that constitutes "changing" the entire code. In fact it
only changes like 1/10000 of the code base.
> If you find real bugs by using pedantic mode, then better send fixes
> for those bugs.
Well it seems to me that one cannot identify bugs using pedantic mode if
one cannot compile at that mode. My objective it to take care of the
outstanding issues which currently cause it to fail. After that, it
will be easier to identify relevant warnings. In the process of this, I
will be submitting changes which fix potential bugs, but I had to start
somewhere, so I started with getting the extensions out of the way.
To give you a taste of what other changes I plan to submit:
1) Squashing "unused" parameter warnings
2) Squashing warnings cause by "a ?:c" (the correct GNU approved way of
writing that is "a ? a : c").
3) Squashing instances of illegal comparisons without proper casts.
Quite frankly, I'm a bit surprised by the hostility you have towards
this patch. If anything, I thought you'd be pleased to see someone
tackle the minor stuff which no one else wants to.
I hope this improves your understanding of my motives and why this patch
More information about the Cygwin-patches