Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2018-10-30
17:38 • Ticket [840660e5a1] fixstrtod.c breaks cross compilation status still Open w... artifact: 5ae5ba9501 user: rkeene
2005-05-21
01:03 • Ticket [1175161fff] compat bugs: strstr.c, strtod.c status still Closed with... artifact: c333a4f99d user: dgp
2005-04-13
18:24 • Ticket [1175161fff]: 4 changes artifact: 38015c6de2 user: nobody
01:34 • Ticket [1175161fff]: 2 changes artifact: 58f2f568af user: kennykb
01:34 • Closed ticket [1175161fff]. artifact: 1a0eae57a1 user: kennykb
01:18 • Ticket [1175161fff]: 4 changes artifact: 4d23dcd04e user: kennykb
2005-04-03
16:06 • Ticket [1175161fff]: 2 changes artifact: 8bb9b585d9 user: dkf
2005-04-02
20:57 • Ticket [1175161fff]: 4 changes artifact: 954a88bc41 user: nobody
01:10 • New ticket [1175161fff]. artifact: 55aac03ba1 user: nobody

compat bugs: strstr.c, strtod.c

Closed / Fixed1175161fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2005-04-02 01:10:59
Hi, everybody. I am trying build a LFS system on my
machine;
but makes some mistake on it. And then I believe I
found two bugs on 8.4.9.

1、compat/strstr.c does not include any header files.
But it uses "return NULL" witch assume that NULL has
been defined as 0.
Solution: add a single line "#define NULL 0" at the
begin of this file.

2、In some configuration, compat/strtod.c needs to be
fixed by fixstrtod.c file. But when it is happen,
symbol "strtod" would be re-defind to "fixstrtod"; so
that "strtod.c" and "strtod.c" would define "fixstrtod"
function twice. The developer have placed a "#undefine
strtod" in file "fixstrtod.c", but it is not work
because it should be placed in "strtod.c" nor
"fixstrtod.c".
Solution: add a single line "#undefine strtod" at the
being of file "strtod.c".
This bug was rare happen because it's just happen in
very spacial configuration. But bug is bug, it should
be solved, right?
nobodyplain2005-04-02 20:57:25
Logged In: NO 

This is the patch that fixes this bug. 
======================================
diff -ru tcl8.4.9/compat/strstr.c tcl8.4.9-1/compat/strstr.c
--- tcl8.4.9/compat/strstr.c2002-01-26 01:10:08.000000000 +0000
+++ tcl8.4.9-1/compat/strstr.c2005-04-02 09:16:06.000000000
+0000
@@ -33,6 +33,8 @@
 
*----------------------------------------------------------------------
  */
 
+#define NULL 0
+
 char *
 strstr(string, substring)
     register char *string;/* String to search. */
diff -ru tcl8.4.9/compat/strtod.c tcl8.4.9-1/compat/strtod.c
--- tcl8.4.9/compat/strtod.c2002-02-25 14:26:12.000000000 +0000
+++ tcl8.4.9-1/compat/strtod.c2005-04-02 09:16:52.000000000
+0000
@@ -24,6 +24,8 @@
 #define NULL 0
 #endif
 
+#undef strtod
+
 static int maxExponent = 511;/* Largest possible base 10
exponent.  Any
  * exponent larger than this will already
  * produce underflow or overflow, so there's
dkf Ticket [1175161fff]: 2 changes [History diff]2005-04-03 16:06:55
kennykbplain2005-04-13 01:18:31
Logged In: YES 
user_id=99768

There is no case where both compat/strtod.c and 
compat/fixstrtod.c should be included in the same build.
compat/fixstrtod.c is included only when the native strtod
is found to have bugs that are specific to certain versions
of Solaris; the 'strtod' routine found in compat/strtod.c
does not have those bugs.  If one of the 'configure' scripts
is causing both to be included, it's buggy.  If instead,
you've edited the Makefile, remove fixstrtod.o from
COMPAT_OBJS and all should be well with strtod.
kennykbplain2005-04-13 01:34:10
Logged In: YES 
user_id=99768

The strstr issue is fixed by adding a conditional definiton
of NULL.
The fixstrtod/strtod issue is puzzling - I'm thinking that your
build must be misconfigured, because no configuration should
ever use both of those routines.
Please reopen with more details about your configuration if
you can't figure out why both strtod and fixstrtod are being
included in the build.
kennykb Ticket [1175161fff]: 2 changes [History diff]2005-04-13 01:34:11
nobodyplain2005-04-13 18:24:38
Logged In: NO 

This bug occurs when I am building native-toolchain in a
x86_64 system. Because of I do not have 32-bit compatible
glibc in my host system, I should use --disable-multilib
flag to build gcc. But I do not do so. So my glibc is buggy
and  the bug happens.

Thanks!
dgpplain2005-05-21 01:03:50
Logged In: YES 
user_id=80530


based on other reports, it appears
likely that this problem is being
encountered when following the
"Linux From Scratch" recipe:

http://lfs.osuosl.org/lfs/view/stable/index.html

In that scenario, a build of Tcl is
attempted quite early, when only
part of the linux system is in place.

(So that Expect, etc. can be used
in the remaining steps of assembling
the system.)

The LFS docs instruct that
Tcl 8.4.7 be used.  The bug reports
are all coming in based on Tcl 8.4.9,
so one possibility is that changes
between those releases have "broken"
the LFS recipe.  

First recommended workaround is
to try with Tcl 8.4.7 as the LFS docs
instruct.

Please report back whether using
Tcl 8.4.7 takes care of the problem
or not.
Log in (anonymous is fine) to add a comment.