This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH/RFA: regerror link error


I wrote :
> the compilation of gdb fails on my system (m68k-motorola-sysv) :
> 
> gcc -g -O2 -W -Wall        -o gdb main.o libgdb.a    ../bfd/libbfd.a ../readline
> /libreadline.a ../opcodes/libopcodes.a ./../intl/libintl.a ../libiberty/libibert
> y.a -lncurses     -lm  ../libiberty/libiberty.a
> libgdb.a(command.o): In function `apropos_command':
> command.c:481: undefined reference to `regerror'
> collect2: ld returned 1 exit status
> 
> Actually, I have found a __regerror, but no regerror.  How can we fix that ?
> 

Following advice from Todd Whitesel and J.T. Conklin,

jtc> I think the __regerror() function in gnu-regex.c needs to be renamed
jtc> regerror().

Todd> Absolutely agree.

Todd> The __ should only be used (and must be used) if the file is part of a
Todd> library provided with a compiler.

Todd> If the file is part of our app, then we should not be defining a __ symbol
Todd> because ANSI C reserves all __ symbols for the compiler's library!

here is a patch :
OK to commit ?

Mon Mar 27 12:23:37 2000  Philippe De Muyter  <phdm@macqel.be>

	* gnu-regex.c (regerror): Function renamed from `__regerror'.

Index: gdb/gnu-regex.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-regex.c,v
retrieving revision 1.1.1.5
diff -u -p -b -r1.1.1.5 gnu-regex.c
--- gnu-regex.c	1999/10/12 04:37:21	1.1.1.5
+++ gnu-regex.c	2000/03/27 10:22:35
@@ -5730,7 +5730,7 @@ weak_alias (__regexec, regexec)
    from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-__regerror (errcode, preg, errbuf, errbuf_size)
+regerror (errcode, preg, errbuf, errbuf_size)
     int errcode;
     const regex_t *preg;
     char *errbuf;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]