compile problem with GNU patch

From: Mark Hardman <mark_at_paperboy.tmnews.com>
Date: Fri, 11 May 2001 13:41:15 -0500 (EST)

First I extend my appreciation for Bill Melvin and sysadmin_at_astro.xx.xx
for confirming my need to move to GNU patch, which I have dowloaded. The
configure script runs fine and produces the makefile just fine, however
make fails with the following...

cc -c -DHAVE_CONFIG_H -Ded_PROGRAM=\"/sbin/ed\" -I. -I. -g util.c
cc: Error: util.c, line 493: In this statement, "va_alist" is not
declared. (undeclared)
  vararg_start (args, format);
--^
cc: Error: util.c, line 527: In this statement, "va_alist" is not
declared. (undeclared)
  vararg_start (args, format);
--^
cc: Error: util.c, line 543: In this statement, "va_alist" is not
declared. (undeclared)
  vararg_start (args, format);
--^
cc: Error: util.c, line 558: In this statement, "va_alist" is not
declared. (undeclared)
  vararg_start (args, format);
--^
cc: Error: util.c, line 618: In this statement, "va_alist" is not
declared. (undeclared)
      vararg_start (args, format);
------^
*** Exit 1



I have found a single reference to this with a "fix" at
http://sources.redhat.com/ml/bug-gnu-utils/1999-09/msg00025.html here are
the details from the page... and frankly i'm in over my head. I am
guessing I need to edit the makefile and as such have attempted by
changing the parameters with regard to the compiler... but this fails as
well. Any help or suggestions appreciated.


Environment
===========
aix: AIX 3.2.5.1, bundeled cc (xlc 1.3.0.44)
     CC=cc CFLAGS=-O ./configure
tru: Digital UNIX V4.0E, bundeled cc
     CC=cc CFLAGS=-O ./configure
ult: ULTRIX V4.5, bundeled cc
     CC=cc CFLAGS="-O -Olimit 1000" ./configure

Problem
=======
aix:
   # cc -c -DHAVE_CONFIG_H -Ded_PROGRAM=\"/usr/bin/ed\" -I. -I. -O util.c
   "util.c", line 493.20: 1506-045 (S) Undeclared identifier va_alist.
tru:
   # cc -c -DHAVE_CONFIG_H -Ded_PROGRAM=\"/usr/ucb/ed\" -I. -I. -O util.c
   cc: Error: util.c, line 493: In this statement, "va_alist" is not
declared.
ult:
   # cc -c -DHAVE_CONFIG_H -Ded_PROGRAM=\"/bin/ed\" -I. -O -Olimit 1000
util.c
   cfe: Error: util.c, line 73: redeclaration of 'move_file'; \
        previous declaration at line 34 in file './util.h'
   cfe: Error: util.c, line 74: prototype and non-prototype declaration
found \
        for move_file, the type of this parameter is not compatible with
the \
        type after applying default argument promotion
    :
   cfe: Error: util.c, line 493: 'va_alist' undefined, reoccurrences will
not \
        be reported

Solution: compile util.c in ANSI mode
========
aix: -qlanglvl=ansi
   # cc -qlanglvl=ansi -c ... -O util.c
tru: -std or -std1
   # cc -std -c ... -O util.c
ult: -std or -std1
   # cc -std -c ... -O -Olimit 1000 util.c

Additional problem: on ult only
==================
   # cc -o patch -O -Olimit 1000 addext.o ... getopt.o
   ld:
   error.o: symbol program_name has incompatible declarations in object
files

Solution: declare program_name in error.c as in common.h
========
   # nm error.o | grep program_name
   0000000004 V program_name [external small undefined]
   # nm util.o | grep program_name
   0000000000 U program_name [external undefined]
   # nm version.o | grep program_name
   0000000000 U program_name [external undefined]
   # vi error.c (line 83: char *program_name -> char const
program_name[])
   # make error.o
   # nm error.o | grep program_name
   0000000000 U program_name
   # cc -o patch -O -Olimit 1000 addext.o ... getopt.o (OK!)

Mark
__________________________
Mark Hardman, SysAdmin/MIS
Bedford Times-Mail
812.277.7286
mark_at_tmnews.com
Received on Fri May 11 2001 - 18:33:09 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:42 NZDT