bug-texinfo
[Top][All Lists]
Advanced

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

Re: TeXinfo-4.0 on IBM AIX 4.2


From: Eli Zaretskii
Subject: Re: TeXinfo-4.0 on IBM AIX 4.2
Date: Wed, 22 Nov 2000 23:00:37 +0200

> From: "Nelson H. F. Beebe" <address@hidden>
> Date: Mon, 20 Nov 2000 08:49:00 -0700 (MST)
> 
> While I was able to force a build of texinfo-4.0 on IBM AIX 4.2
> with CC=cc, my normal build procedure with CC=c89 failed because
> of stricter type checking:

Thanks for reporting this.

> c89 -c -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGNULOCALEDIR=\"/usr/local/share/locale\"
> -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I.
> -I../intl -I../lib  -g  finddomain.c
> "finddomain.c", line 147.14: 1506-068 (S) Operation between types "char*" and
> "int" is not allowed.
> 
> c89 -c -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGNULOCALEDIR=\"/usr/local/share/locale\"
> -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I.
> -I../intl -I../lib  -g  intl-compat.c
> c89 -c -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGNULOCALEDIR=\"/usr/local/share/locale\"
> -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I.
> -I../intl -I../lib  -g  bindtextdom.c
> "bindtextdom.c", line 116.27: 1506-068 (S) Operation between types "char*"
> and "int" is not allowed.

These (and a bunch of other) warnings are all about strdup.  I'm
guessing that strdup's prototype was not visible to the compiler,
although HAVE_STRDUP is defined by config.h.  Could you please look
into the system headers and see why is that?

(Btw, you did rerun ./configure with CC=c89 before trying to build
with c89, yes?)

> c89 -c -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGNULOCALEDIR=\"/usr/local/share/locale\"
> -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I.
> -I../intl -I../lib  -g  dcgettext.c
> "dcgettext.c", line 276.29: 1506-045 (S) Undeclared identifier PATH_MAX.
> make[2]: [dcgettext.o] Error 1 (ignored)

Similar here: somehow, PATH_MAX is not in the headers that the
compiler sees.  Can you tell why?

> c89 -c -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGNULOCALEDIR=\"/usr/local/share/locale\"
> -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I.
> -I../intl -I../lib  -g  loadmsgcat.c
> "loadmsgcat.c", line 69.10: 1506-007 (S) "struct stat" is undefined.
> "loadmsgcat.c", line 88.37: 1506-045 (S) Undeclared identifier O_RDONLY.

These two have me stumped: loadmsgcat.c includes these 3 headers
unconditionally:

    #include <fcntl.h>
    #include <sys/types.h>
    #include <sys/stat.h>

So how come struct stat, which is in sys/stat.h, and O_RDONLY, which
is in fcntl.h, are not visible by the compiler?

Can it be that c89 masks non-ANSI parts of the headers, to avoid
pollution of the ANSI namespace with non-ANSI identifiers?  If so, you
cannot build Texinfo (and just about any other real-life Posix
program) with that compiler.

Perhaps c89 features some switch that allows non-ANSI parts of the
system headers to be visible?  If so, you should use it.

> "localealias.c", line 258.18: 1506-280 (E) Function argument assignment
> between types "char*" and "unsigned char*" is not allowed.

This is nitpicking, but a simple cast should take care of it.

> c89 -DHAVE_CONFIG_H -I. -I. -I.. -I../intl    -g -c substring.c
> "/usr/include/sys/lock_def.h", line 226.1: 1506-166 (S) Definition of
> function boolean_t requires parentheses.
> "/usr/include/sys/lock_def.h", line 226.11: 1506-276 (S) Syntax error:
> possible missing '{'?
> "/usr/include/sys/pcl.h", line 77.9: 1506-007 (S) "struct priv" is undefined.
> "/usr/include/sys/pcl.h", line 118.9: 1506-007 (S) "struct priv" is
> undefined.

This looks like the compiler doesn't even like its own system
headers??

> "/usr/include/sys/cred.h", line 51.9: 1506-046 (S) Syntax error.
> "/usr/include/sys/cred.h", line 68.9: 1506-007 (S) "struct priv" is
> undefined.
> "/usr/include/sys/cred.h", line 74.9: 1506-007 (S) "struct priv" is
> undefined.
> "/usr/include/sys/cred.h", line 80.9: 1506-007 (S) "struct priv" is
> undefined.
> "/usr/include/sys/cred.h", line 86.9: 1506-007 (S) "struct priv" is
> undefined.

Same here.

> There were a lot more of this flavor.  Since texinfo is essentially
> a filter, reading a text file, and producing a text file, there seems
> to be no reason why it should not be compilable in a strict Standard C
> environment.

Texinfo is not a filter: it deals with files (as opposed to a filter
which reads stdin and writes stdout).  Therefore, it needs to see the
preprocessing macros and function prototypes for the Posix functions
that deal with files.  Many of these functions are not part of ANSI C.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]