[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libc6-dev and "-pedantic -O" warnings



Some packages which compiled warning free under libc6 2.0 now generate
warnings under libc6 2.1.  Some of these warning are due to poor
practices in the programs themselves (and in those cases I am fixing
the code), but other warnings are due to optimization macros in the
include files which do not pass strict warning settings.  Here is a
simple example:

  $ cat toupper.c
  #include <stdio.h>
  #include <ctype.h>
  int main(void) {
    char c;
    c = toupper('a');
    printf("toupper('a') = '%c'\n", c);
    return 0;
  }
  $ gcc -pedantic -O toupper.c
  toupper.c: In function `main':
  toupper.c:5: warning: ANSI C forbids braced-groups within expressions
  $

Is this a bug, or can we no longer expect well written code to compile
warning free when optimizing?

Kirk


Reply to: