Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-03-23
05:31 • Ticket [531931ffff] TCL_DEFS has SPC if "long long" allowed status... artifact: 8f479fc9de user: hobbs
05:28 • Ticket [531931ffff]: 7 changes artifact: fc4c2e1aeb user: jcw
05:28 • Closed ticket [531931ffff]. artifact: 731d9ce648 user: jcw
04:41 • Ticket [531931ffff]: 5 changes artifact: 2a5c9b736e user: hobbs
2002-03-19
16:47 • New ticket [531931ffff]. artifact: 8461bd2f04 user: jcw

TCL_DEFS has SPC if "long long" allowed

Closed531931ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-03-19 16:47:29
On my Linux box with 64-bit support, the TCL_DEFS 
variable definition in tclConfig.sh has the form:

  TCLDEFS=' .... -Dblah=long\ long ...'

That is extremely hard to use in shell scripts 
(impossible?), because the quoting gets lost.  The 
following test script fails, when run in tcl/unix/:

  . tclConfig.sh
  gcc -c $TCL_DEFS tclAppInit.c

The error is that it loses the backslash, and 
complains about not finding the source file named 
"long".

I've tried all sorts of quoting tactics, to no avail.

One workaround is to add the following to tcl.h:
#define TCL_LONGLONG long long
Then, alter the logic to emit the following to 
tclCobfig.sh instead:

  TCLDEFS=' .... -Dblah=TCL_LONGLONG ...'

There's also a "int64_t" defined on Linux in 
"stdint.h", but that file is probably not available 
everywhere.
hobbsplain2002-03-23 04:41:06
Logged In: YES 
user_id=72656

int64_t can't be used because it's a typedef that cannot 
be "unsigned", and then you have to check for an unsigned 
64-bit type.

The way that the TEA stuff uses TCL_DEFS doesn't seem to 
worry about the fact that it's defined as 'long\ long', 
perhaps pointers for your build system can be taken from 
there?
jcw Closed ticket [531931ffff]. [History diff]2002-03-23 05:28:41
jcwplain2002-03-23 05:28:42
Logged In: YES 
user_id=1983

I was trying to suggest a simpler solution, but I suppose the 
tradeoff is debatable.

Yes, I've worked around this in the way I now build things.

Thanks.
hobbsplain2002-03-23 05:31:18
Logged In: YES 
user_id=72656

I think the problem is that the "unquoted" version that is 
used by Tcl is what is needed for it to work in the C 
code.  #defines are a capricious thing.
Log in (anonymous is fine) to add a comment.