Bug 35961 - Erroneous error message using gcc-4.3.0 when signedness warning thrown
Summary: Erroneous error message using gcc-4.3.0 when signedness warning thrown
Status: RESOLVED DUPLICATE of bug 28322
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-17 02:22 UTC by TJ Saunders
Modified: 2008-05-05 16:15 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TJ Saunders 2008-04-17 02:22:44 UTC
When compiling the recent proftpd-1.3.2rc1 source code using gcc-4.3.0, a user reported a problem where gcc reports a problem with the -Wno-long-double option:

  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2 -Wall
    -Wno-long-double -c mod_sql.c
  mod_sql.c: In function 'check_auth_openssl':
  mod_sql.c:685: warning: pointer targets in passing argument 3 of
  'EVP_DigestFinal' differ in signedness
  mod_sql.c:688: warning: pointer targets in passing argument 1 of
  'EVP_EncodeBlock' differ in signedness
  At top level:
  cc1: error: unrecognized command line option "-Wno-long-double"
  make[1]: *** [mod_sql.o] Error 1

However, I verified that gcc-4.3.0 does in fact support -Wno-long-double, using:

  # echo 'void f(){}' > conftest.c
  # gcc -c -Wno-long-double conftest.c 2>&1
  # echo $?
  0

So the error about "-Wno-long-double" appears to be misleading.  In fact, a fuller output from using gcc-4.3.0 for the proftpd-1.3.2rc1 source code shows several successful gcc invocations with that option:

  flecha:/usr/local/src/proftpd/proftpd-1.3.2rc1# make
  echo \#define BUILD_STAMP \"`date`\" >include/buildstamp.h
  cd lib/ && make lib
  make[1]: Entering directory `/usr/local/src/proftpd/proftpd-1.3.2rc1/lib'
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c pr_fnmatch.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c sstrncpy.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c strsep.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c vsnprintf.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c glibc-glob.c
  ...
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c mod_ident.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c mod_auth_pam.c
  gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I/usr/include/mysql -O2
    -Wall -Wno-long-double -c mod_sql.c
  mod_sql.c: In function 'check_auth_openssl':
  mod_sql.c:685: warning: pointer targets in passing argument 3 of
  'EVP_DigestFinal' differ in signedness
  mod_sql.c:688: warning: pointer targets in passing argument 1 of
  'EVP_EncodeBlock' differ in signedness
  At top level:
  cc1: error: unrecognized command line option "-Wno-long-double"

I suspect that the root problem was the warning about the signedness discrepancy, and not the -Wno-long-double option at all.

For comparison, using gcc-4.2 works.
Comment 1 Andrew Pinski 2008-05-05 05:36:39 UTC
This is expected behavior.  We no longer error out about an unkown warning option unless there is an error/warning already.
Comment 2 TJ Saunders 2008-05-05 16:11:43 UTC
What was the reasoning behind this change in behavior?  It violates the principle of least surprise, and will cause problems for e.g. configure scripts which use simple tests to determine whether the system's compiler accepts a particular command-line option.
Comment 3 Andrew Pinski 2008-05-05 16:15:33 UTC
(In reply to comment #2)
> What was the reasoning behind this change in behavior?

See PR 28322.

*** This bug has been marked as a duplicate of 28322 ***