This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Default warnings and useless extensions (e.g. arithmetic on void *)


On 2008-06-10 11:26:32 +0200, Richard Guenther wrote:
> On Tue, Jun 10, 2008 at 9:07 AM, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
> > On 2008-06-09 16:02:05 +0200, Richard Guenther wrote:
> >> Use -pedantic to warn about extensions. It doesn't make sense to
> >> warn for extensions if they are not deprecated. After all they are
> >> extensions.
> >
> > The problem with -pedantic is that it gives lots of spurious warnings.
> > We have code that uses useful (i.e. with no workarounds) extensions
> > and that is protected by #if, e.g.
> >
> > #ifdef HAVE_LONG_LONG
> >            case LONG_LONG_ARG:
> >              *(long long *) p = (long long) nchar;
> >              break;
> > #endif
> 
> In this specific case selecting C99 would fix it.  (-std=c99 -pedantic)

Of course, one can't use -std=c99, because not everyone has gcc 4.x.
So, the problem is still there. And even -std=gnu99 -pedantic doesn't
solve the problem since there are other spurious warnings (for code
enabled by the preprocessor if the compiler is gcc). Now I think that
this can be dealt with by making the configure.in even more complex. :(

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]