sc 6.1 - Allow ANSI pre-processor and read-only strings

T. William Wells bill at twwells.uucp
Tue Apr 4 11:23:53 AEST 1989


In article <16445 at yoyodyne.mips.COM> koblas at mips.COM (David Koblas) writes:
: In article <137 at titania.warwick.ac.uk> cudcv at warwick.ac.uk (Rob McMahon) writes:
: >
: >! #define ctl(x) ('x'&037)
: >
: >--- 65,71 ----
: >
: >! #define ctl(x) ((x)&037)
: >
:
: Instead of doing this change there is a much simpler solution, which
: of course allows you to not make such a huge change to existing code.
:
: #ifdef __STDC___
: # define ctl(x)       (#x[0]&037)
: #else
: # define ctl(x) ('x'&037)
: #endif

What makes you think that it is only ANSI that doesn't allow the 'x'
to be expanded? Well, here's some news: there are comparatively few
compilers that will expand the 'x'. Most don't. ANSI is merely
formalizing this situation.

Also, I wouldn't use your suggestion for ANSI: unless you have a
smart compiler writer, that is likely to generate allocated memory
for the string even though the string is never used.

---
Bill                            { uunet | novavax } !twwells!bill
(BTW, I'm may be looking for a new job sometime in the next few
months.  If you know of a good one where I can be based in South
Florida do send me e-mail.)



More information about the Comp.sources.bugs mailing list