bug-indent
[Top][All Lists]
Advanced

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

indent-2.2.10 compilation issues


From: Richard A. O'Keefe
Subject: indent-2.2.10 compilation issues
Date: Tue, 14 Mar 2017 15:52:55 +1300

Version: indent 2.2.10 downloaded 2017.03.14

System: OS X El Capitan version 10.11.3

Compiler: clang
% gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Issues.

In file included from lexi.c:205:
./gperf.c:103:3: warning: non-constant static local variable in inline function
      may be different in different files [-Wstatic-local-in-inline]
  static unsigned char lengthtable[] =
  ^
lexi.c:201:1: note: use 'static' to give inline function 'is_reserved' internal
      linkage
__inline
^
static 
In file included from lexi.c:205:
./gperf.c:109:3: warning: non-constant static local variable in inline function
      may be different in different files [-Wstatic-local-in-inline]
  static templ_ty wordlist[] =
  ^
lexi.c:201:1: note: use 'static' to give inline function 'is_reserved' internal
      linkage
__inline
^
static 
In file included from lexi.c:205:
indent.gperf:12:3: warning: non-constant static local variable in inline
      function may be different in different files [-Wstatic-local-in-inline]
  static short lookup[] =
  ^
lexi.c:201:1: note: use 'static' to give inline function 'is_reserved' internal
      linkage
__inline
^
static 
In file included from lexi.c:219:
./gperf-cc.c:104:3: warning: non-constant static local variable in inline
      function may be different in different files [-Wstatic-local-in-inline]
  static unsigned char lengthtable[] =
  ^
lexi.c:215:1: note: use 'static' to give inline function 'is_reserved_cc'
      internal linkage
__inline
^
static 
In file included from lexi.c:219:
./gperf-cc.c:111:3: warning: non-constant static local variable in inline
      function may be different in different files [-Wstatic-local-in-inline]
  static templ_ty wordlist[] =
  ^
lexi.c:215:1: note: use 'static' to give inline function 'is_reserved_cc'
      internal linkage
__inline
^
static 
In file included from lexi.c:219:
indent-cc.gperf:12:3: warning: non-constant static local variable in inline
      function may be different in different files [-Wstatic-local-in-inline]
  static short lookup[] =
  ^
lexi.c:215:1: note: use 'static' to give inline function 'is_reserved_cc'
      internal linkage
__inline
^
static 
6 warnings generated.


SOLUTION: follow the hint in the compiler warnings and declare
these tables 'const'.

gperf-cc.c:52:  static unsigned char const asso_values[] =
gperf-cc.c:104:  static unsigned char const lengthtable[] =
gperf-cc.c:111:  static templ_ty const wordlist[] =
gperf-cc.c:211:  static short const lookup[] =
gperf.c:52:  static unsigned char const asso_values[] =
gperf.c:103:  static unsigned char const lengthtable[] =
gperf.c:109:  static templ_ty const wordlist[] =
gperf.c:177:  static short const lookup[] =

That fix results in two warnings.

In file included from lexi.c:205:
indent.gperf:34:28: warning: returning 'const templ_ty *' from a function with
      result type 'templ_ty *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
                    return &wordlist[index];
                           ^~~~~~~~~~~~~~~~
In file included from lexi.c:219:
indent-cc.gperf:36:28: warning: returning 'const templ_ty *' from a function
      with result type 'templ_ty *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
                    return &wordlist[index];
                           ^~~~~~~~~~~~~~~~
2 warnings generated.

SOLUTION: make is_reserved[_cc] return tmpl_ty const *.
Make the corresponding changes to lexi.c.

gperf.c:98:templ_ty const *
gperf-cc.c:99:templ_ty const *
lexi.c:203:templ_ty const *is_reserved (const char *str, unsigned int len);
lexi.c:217:templ_ty const *is_reserved_cc (register const char *str, register 
unsigned int len);
lexi.c:276:      templ_ty const *p;



output.c:752:33: warning: field precision should have type 'int', but argument
      has type 'long' [-Wformat]
            fprintf (output, "%.*s", e_lab - s, s);
                              ~~^~   ~~~~~~~~~
output.c:756:36: warning: field precision should have type 'int', but argument
      has type 'long' [-Wformat]
            fprintf (output, "/* %.*s */", e_lab - s, s);
                                 ~~^~      ~~~~~~~~~
2 warnings generated.

SOLUTION: e_lab - s is of type ptrdiff_t, which is 64 bits on
this machine, not 32 bits.  However, the range of values should
fit into an int, so the simplest change is to cast these
differences to int.

texinfo2man.c:3:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^
1 error generated.


SOLUTION: There has NEVER been a <malloc.h> in any version of the
C standard.  C89 and all later C standards require the memory
management functions to be declared in <stdlib.h>, which is
already included.  So just comment the bad line out.
man/texinfo2man.c:3:/*#include <malloc.h> -- standardly in stdlib.h */

texinfo2man.c:166:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
process_texi (FILE * in)
^
texinfo2man.c:247:1: warning: control may reach end of non-void function
      [-Wreturn-type]
}
^
2 warnings generated.

SOLUTION:  the function is not supposed to return anything,
so use the pre-ANSI 'void' type.

man/texinfo2man.c:166:void process_texi (FILE * in)


There are numerous warnings about printf formats that
are not string literals, which actually show that the
indent source code is doing internationalisation right.
Manual inspection shows that there are no % items in
these strings, so no int/long mismatches are hiding
there.

SOLUTION:  do nothing.

/home/cshome/o/ok/Downloads/indent-2.2.10/config/missing texi2html -expandinfo 
-number -monolithic `if test -f indent.texinfo; then echo indent.texinfo; else 
echo ./indent.texinfo; fi`
WARNING: `texi2html' is needed, and is missing on your system.
         You might have modified some files without having the
         proper tools for further handling them.  Check the `README' file,
         it often tells you about the needed prerequisites for installing
         this package.  You may also peek at any GNU archive site, in case
         some other package would contain this missing `texi2html' program.

SOLUTION:  according to the TexInfo manual section 20.8,
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/texi2html.html
texi2html is dead and "the route forward for authors is alter manuals
and build processes as necessary to use the new features and methods
of texi2any".  Using the "approximation"
texi2any --set-customization-variable TEXI2HTML=1 
recommended in the TeXInfo manual does not work.
The simplest solution I could think of was to purge all reference
to HTML from doc/Makefile, but that is not a lasting solution.
The lasting solution is to upgrade the build process to use
current texinfo's texi2any.







reply via email to

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