From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.10 (X11; Linux i686; U;) Gecko/20030314 Description of problem: Following C source compiles cleanly with gcc -c -W -Wno-system-headers -O #include <math.h> int main(int argc, char *argv[]) { if (!argc) return 1; else return 0; } If one however changes the `return 1' to just `return', and thus creating a function that can return either with or without a value #include <math.h> int main(int argc, char *argv[]) { if (!argc) return; else return 0; } gcc notices it not only in this source, but in math.h too, giving a few dozens of warnings starting with /usr/include/bits/mathinline.h: In function `__sgn': /usr/include/bits/mathinline.h:291: warning: this function may return with or without a value /usr/include/bits/mathinline.h: In function `__sgnf': /usr/include/bits/mathinline.h:291: warning: this function may return with or without a value ... Version-Release number of selected component (if applicable): gcc-3.2.2-5 How reproducible: Always Steps to Reproduce: 1. create file z.c, as described in the second example above 2. compile it gcc -c -W -Wno-system-headers -O z.c 3. for comparison, do the same with the first example above Actual Results: Described above. Expected Results: Only a single warning: z.c: In function `main': z.c:7: warning: this function may return with or without a value Additional info:
See http://gcc.gnu.org/PR9862 I'll commit backport of that path to gcc-3_2-rhl8-branch and it will show up in the next gcc-3.2.3-rh rpms.
An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2003-354.html