bug-texinfo
[Top][All Lists]
Advanced

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

texinfo-4.3 -- a patch to get rid of gcc warnings


From: Peter Breitenlohner
Subject: texinfo-4.3 -- a patch to get rid of gcc warnings
Date: Sat, 16 Nov 2002 16:51:26 +0100 (CET)

Hi Karl,

I just built texinfo-4.3 (on ix86-linux-gnu with gcc-2.95.3) and saw
that there are a lots of gcc warnings. They all concern the use of constant
strings, i.e. `const char *' in assignments to non-constant `char *'
variables, as initializer for such variables, or as arguments of that type.

I think these warnings are all legitimate and point to the potential problem
that the constant strings could be modified by the program.

Therefore, I would like to suggest the attached patch. Except in one case
(in makeinfo/index.c index_node was used first for a constant a then for a
modifiable string) the patch just adds a bunch of `const's to existing
declarations. From the fact that the patch removes all gcc warnings, I
deduce that the above mentioned problem doesn't actually occur in the
texinfo-4.3 code (as far as the compiler can detect, since the majority of
functions is used without suitable prototypes).

NB: Does texinfo (and other GNU software) actually still support
prototype-unaware compilers. If not, it might be a good idea to supply all
necessary prototypes. Or even better supply them in any case with the
        TYPE name _P((ARG TYES));
syntax. I know that doing this is rather tedious, but a lot of subtle bugs
have been found this way (in other programs).

regards
Peter Breitenlohner <address@hidden>

Attachment: texinfo-4.3-patch
Description: Text document


reply via email to

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