Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Steve Emmerson
Thu, 03 Sep 1992 04:02
autoconf 1.1: bug defining `const' to empty string
Author: Steve Emmerson
Date: Thu, 03 Sep 1992 04:02
Date: Thu, 03 Sep 1992 04:02
94 lines
2763 bytes
2763 bytes
Greetings,
PROBLEM STATEMENT:
autoconf version 1.1 does not correctly define the keyword `const' to
be the empty string in environments that do not support `const'.
REPEAT BY:
The following was executed on a DECstaton 3100 running ULTRIX 4.2:
% cat configure.in
AC_INIT(configure.in)
AC_CONFIG_HEADER(config.h)
AC_CONST
AC_OUTPUT(Makefile)
% cat config.h.in
#undef const
#define const const
% autoconf --version
Autoconf version 1.1
% CC=cc ./configure
checking for working const
creating config.status
creating Makefile
creating config.h
% cat config.h
/* config.h. Generated automatically by configure. */
#undef const
#define const const
%
In the specified environment, the last two lines in file `config.h'
should have been
# define const
# define const
That this is so can be seen from the relevant lines in file
`config.status':
% sed -n 15,16p config.status
DEFS='#define const
'
%
POSSIBLE FIX:
Apply the following patch to file `acgeneral.m4':
% diff -c acgeneral.m4.dist acgeneral.m4
*** acgeneral.m4.dist Sun Aug 23 19:15:02 1992
--- acgeneral.m4 Thu Sep 3 09:00:51 1992
***************
*** 476,492 ****
BEGIN { filenum = 1 }
filenum == 1 && <<$>>1 == "#define" \
{ defs[<<$>>2] = <<$>>3
for (i = 4; i <= NF; i++)
defs[<<$>>2] = defs[<<$>>2] " " <<$>>i
}
/END_OF_DEFS/ { filenum = 2; next }
filenum == 2 && <<$>>1 == "#define" && \
! defs[<<$>>2] != "" {
<<$>>3 = defs[<<$>>2]
print; next
}
filenum == 2 && <<$>>1 == "#undef" && \
! defs[<<$>>2] != "" {
<<$>>1 = "#define"
<<$>>2 = <<$>>2 " " defs[<<$>>2]
print; next
--- 476,493 ----
BEGIN { filenum = 1 }
filenum == 1 && <<$>>1 == "#define" \
{ defs[<<$>>2] = <<$>>3
+ hasdef[<<$>>2] = 1
for (i = 4; i <= NF; i++)
defs[<<$>>2] = defs[<<$>>2] " " <<$>>i
}
/END_OF_DEFS/ { filenum = 2; next }
filenum == 2 && <<$>>1 == "#define" && \
! hasdef[<<$>>2] == 1 {
<<$>>3 = defs[<<$>>2]
print; next
}
filenum == 2 && <<$>>1 == "#undef" && \
! hasdef[<<$>>2] == 1 {
<<$>>1 = "#define"
<<$>>2 = <<$>>2 " " defs[<<$>>2]
print; next
Regards,
Steve Emmerson <steve@unidata.ucar.edu>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads