Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-11-05
02:42 • Ticket [1195139fff] NULL undefined in strstr.c status still Closed with 2 ot... artifact: f9304985ed user: kennykb
02:42 • Closed ticket [1195139fff]. artifact: e2460887a9 user: kennykb
2005-05-31
22:17 • Open ticket [1195139fff]. artifact: 8167f82c75 user: kennykb
22:06 • Closed ticket [1195139fff]. artifact: ad83343f94 user: dkf
21:13 • Ticket [1195139fff]: 4 changes artifact: 2a0997b223 user: ivan_daniluk
20:26 • Ticket [1195139fff]: 4 changes artifact: 6123fd53a6 user: kennykb
20:26 • Ticket [1195139fff]: 1 change artifact: 1d50fe6e4a user: kennykb
20:23 • Ticket [1195139fff]: 4 changes artifact: f4986ca2f1 user: dkf
2005-05-30
12:51 • Ticket [1195139fff]: 4 changes artifact: 4a67eb5504 user: ivan_daniluk
08:55 • Ticket [1195139fff]: 1 change artifact: ad4700cf39 user: hobbs
2005-05-04
11:28 • New ticket [1195139fff]. artifact: 7fefabc9d2 user: nobody

NULL undefined in strstr.c

Closed / Invalid1195139fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2005-05-04 11:28:19
The function strstr() in compat/strstr.c uses NULL as a 
return value but NULL is not defined, neither locally nor 
by inclusion of an appropriate header file.
I discovered this when cross-compiling the latest 
tcl8.4.9 source code on a Linux x86 platform targetting 
an embedded PowerPC 60x running Linux. The 
configure script correctly detected that the strstr() 
function needed to be build for this platform, but the 
subsequent compilation failed because of the undefined 
NULL. Fixing is trivial.
hobbs Ticket [1195139fff]: 1 change [History diff]2005-05-30 08:55:47
ivan_danilukplain2005-05-30 12:51:22
Logged In: YES 
user_id=902311

I've got the same when crosscompiling tcl8.4.9 on x86 with
uClibc.
Just added "#include <unistd.h>" to compat/strstr.h.
dkfplain2005-05-31 20:23:59
Logged In: YES 
user_id=79902

Is this relating to Linux From Scratch? Apparently there are
problems elsewhere in the toolchain that are causing
troubles here; this is the subject of current issue reports
elsewhere (LFS bugzilla?) and is not actually the result of
real bugs in Tcl we believe.
kennykb Ticket [1195139fff]: 1 change [History diff]2005-05-31 20:26:23
kennykbplain2005-05-31 20:26:24
Logged In: YES 
user_id=99768

I am seriously contemplating removing compat/strstr.c entirely.

This problem is indicative of a broken toolchain. No
compiler that supports the basic ISO C89 functionality
requires compat/strstr.c - the configurator has incorrectly
detected the need for it because either a compilation step
is failing entirely or else it is totally unable to link with
the standard library.

This module always appears to be the "lightning rod"
for this problem - which, as I understand it, is reported
earlier in "configure" - can you please check from
"make distclean" and report back with what error
messages came out of the "configure" step?

By the way, most people reporting this problem are
running afoul of an error in the instructions for
Linux From Scratch.  The Tcl core team is working with
the Linux From Scratch developers to resolve
the issue. See
http://aspn.activestate.com/ASPN/Mail/Message/tcl-core/2595523
for further details.
ivan_danilukplain2005-05-31 21:13:29
Logged In: YES 
user_id=902311

2 dkf:
I has been crosscompile tcl with toolchain, builded by
buildroot(http://buildroot.uclibc.org), it has very strict
makefiles standart.
Many other packages build perfectly.

2 kennykb:
There were no error by configure, just warning:
--- from config.log ---
configure:4174: checking for strstr
configure:4202:
/home/divan/builddir/buildroot/build_i386/staging_dir/bin/i386-linux-uclibc-gcc
-pipe -o conftest -Os -pipe -march=pentium3   
-Wl,--export-dynamic conftest.c  1>&5
configure:4186: warning: conflicting types for built-in
function 'strstr'
------
dkfplain2005-05-31 22:06:51
Logged In: YES 
user_id=79902

Dup of bug 1175161 (fixed in HEAD)
kennykbplain2005-05-31 22:17:19
Logged In: YES 
user_id=99768

Donal, let's not close this one just yet.

It appears that we have a couple of problems with the
configurator here.

First, cross-compiles are universally detected as "broken".
This causes a conflict because compat/strtod.c and
compat/fixstrtod.c will both be included, and they're
incompatible.

Second, there's an apparent issue where unix/configure is
including  system headers in the AC_TRY_RUN, and the
declaration of strstr at line 219 of unix/configure.in
causes a type conflict (and potential failure).  I still
contend that the best fix for this problem is to take it out
entirely - what compiler lacks strstr nowadays?
kennykbplain2005-11-05 02:42:22
Logged In: YES 
user_id=99768

Since the underlying problem was a broken toolchain in LFS,
I'm closing out this incident.  No functioning toolchain
encounters
this error.
kennykb Ticket [1195139fff]: 2 changes [History diff]2005-11-05 02:42:23
Log in (anonymous is fine) to add a comment.