This is the mail archive of the gcc-bugs@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]

Re: -Wno-return-type doesn't seem to work.


> on Solaris I have the problem that gcc-2.95 generates enormous amounts
> of warning messages from sloppy Motif include files.

Thanks for your bug report. Your observations are all correct, and
most of your conclusions are as well.

> I understand that you end up in line (1) when pedantic or when the
> declared function is not main. I.e. any (flawed) function declaration
> with the exception of main triggers the pedwarn and line (2) is almost
> never reached. Therefore the test for warn_return_type does not help.

Exactly. However, this is intentional.

> The deeper problem on my Sun installation seems to be that it does not
> qualify the file named "/usr/openwin/share/include/X11/Intrinsic.h" as
> a system header. Obviously this worked on all your systems such that
> you did not notice the above described problem.

No. This is a well-known problem, please see

http://egcs.cygnus.com/faq.html#X11R6

The issue is that Sun keeps shipping X11 header file which do not
compile as C++ source, even though
a) they should know about the problem for years, and
b) replacement header files have been available from the X11
   consortium for the same time

So, you should complain to your operating system vendor about not
conforming to international standards, instead of to your compiler
vendor for doing so.

Because this is such a familiar problem, g++ only emits a warning and
still accepts the code, as an extensions. In pedantic mode, you'll get
an error.

If you absolutely can't live with the warning: Well, you got the
source to both the compiler, and the X11 headers.

Regards,
Martin


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