[Bug 1166105] Re: incorrect error message ('-Werror=edantic') with -pedantic

Matthias Klose doko at ubuntu.com
Mon Apr 8 09:59:53 UTC 2013


>From the GCC 4.8 release notes:

The new option -Wpedantic is an alias for -pedantic, which is now
deprecated. The forms -Wno-pedantic, -Werror=pedantic, and -Wno-
error=pedantic work in the same way as for any other -W option. One
caveat is that -Werror=pedantic is not equivalent to -pedantic-errors,
since the latter makes into errors some warnings that are not controlled
by -Wpedantic, and the former only affects diagnostics that are disabled
when using -Wno-pedantic.

Won't fix for 4.7.

** Package changed: gcc-defaults (Ubuntu) => gcc-4.7 (Ubuntu)

** Changed in: gcc-4.7 (Ubuntu)
       Status: New => Won't Fix

** Also affects: gcc-defaults (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1166105

Title:
  incorrect error message ('-Werror=edantic') with -pedantic

Status in “gcc-4.7” package in Ubuntu:
  Won't Fix
Status in “gcc-defaults” package in Ubuntu:
  New

Bug description:
  Specifying '-pedantic' and '-Werror' together with a file that
  triggers a pedantic warning results in an incorrect message:

  $ gcc -Werror foo.c
  foo.c: In function ‘main’:
  foo.c:21:5: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
  foo.c:21:5: note: use option -std=c99 or -std=gnu99 to compile your code
  $ gcc -pedantic -Werror foo.c
  foo.c:14:6: erreur: ISO C90 doesn’t support unnamed structs/unions [-Werror=edantic]
  foo.c: In function ‘main’:
  foo.c:21:5: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
  foo.c:21:5: note: use option -std=c99 or -std=gnu99 to compile your code
  cc1: all warnings being treated as errors
  $ gcc -Werror -pedantic foo.c
  foo.c:14:6: erreur: ISO C90 doesn’t support unnamed structs/unions [-Werror=edantic]
  foo.c: In function ‘main’:
  foo.c:21:5: erreur: ‘for’ loop initial declarations are only allowed in C99 mode
  foo.c:21:5: note: use option -std=c99 or -std=gnu99 to compile your code
  cc1: all warnings being treated as errors

  Note that '-Werror=edantic' is truncated. Presumably, it should be
  showing '-Werror=pedantic'?

  Note however that both '-Werror=edantic' and '-Werror=pedantic' are
  (currently) invalid gcc options.

  ProblemType: Bug
  DistroRelease: Ubuntu 13.04
  Package: gcc 4:4.7.2-1ubuntu8
  ProcVersionSignature: Ubuntu 3.8.0-16.26-generic 3.8.5
  Uname: Linux 3.8.0-16-generic i686
  NonfreeKernelModules: nvidia
  ApportVersion: 2.9.2-0ubuntu5
  Architecture: i386
  Date: Mon Apr  8 10:36:45 2013
  InstallationDate: Installed on 2010-10-21 (900 days ago)
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
  MarkForUpload: True
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=C
   SHELL=/bin/bash
  SourcePackage: gcc-defaults
  UpgradeStatus: Upgraded to raring on 2012-12-20 (108 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1166105/+subscriptions




More information about the foundations-bugs mailing list