Subject: compiling with --pedantic

From: Dominik Vogt <[email-masked]>
Date: Fri, 9 Jul 1999 17:18:36 +0200

I have cleaned up the code so that fvwm and all modules
compile without warnings, even when compiling with
"-Wall -Werror --pedantic". But there are three issues I could
not resolve. Could one of our portability cracks take a look at this?

Now the problems:

 1) "inline" is not allowed by ANSI
    It is used once in module_interface.c and several times
    in glib.h (i.e. in an external dependency). Can we do
    something about it to keep gcc quiet?

 2) In the file /usr/include/socketbits.h I found this:
      #if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
          unsigned char __cmsg_data[0]; /* Ancillary data.  */
      #endif                      ^^^^^

    A zero array size is illegal. I'm using a Linux 2.2.5 kernel.

 3) glib/gtk produce massive warnings (used only in FvwmGtk).
    Can we disable checking for glib and gtk headers somehow?

I would like to be able to compile without any warnings.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 09 Jul 1999 13:54:27 -0400

%% Dominik Vogt <[email-masked]> writes:

  dv>  1) "inline" is not allowed by ANSI
  dv>     It is used once in module_interface.c and several times
  dv>     in glib.h (i.e. in an external dependency). Can we do
  dv>     something about it to keep gcc quiet?

If you really want to run with these options you have to run _configure_
with them, too.

Running configure with one "style" of C (GNU C) and the build with
another (ANSI pedantic C) is a sure way to get errors and warnings.
There's nothing we can do about this; "configure" is the tool that's
supposed to examine the compiler and determine which features beyond
ANSI we have available.

If you do something like:

  $ CC='gcc -Wall -Werror -pedantic' ./configure ...

and then the compile still gives these warnings, I guess that's a
problem with our configure script somewhere; I'd have to look at it.

  dv>  2) In the file /usr/include/socketbits.h I found this:
  dv>       #if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
  dv>           unsigned char __cmsg_data[0]; /* Ancillary data.  */
  dv>       #endif                      ^^^^^

  dv>     A zero array size is illegal. I'm using a Linux 2.2.5 kernel.

Note that this _will_ be legal in the next standard (it's the blessed
way to handle the "struct hack").

Other than that, see my point for #1.

  dv>  3) glib/gtk produce massive warnings (used only in FvwmGtk).
  dv>     Can we disable checking for glib and gtk headers somehow?

Not that I know of.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 10 Jul 1999 01:38:53 +0200

> problem with our configure script somewhere; I'd have to look at it.

Nope, that does not help. If I configure like you said I still get
the 'inline' warning.

Bye

Dominik ^_^