Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: cornelius@eisner.decus.org (George Cornelius)
Subject: Re: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA *
Date: 1998/08/28	[thread overview]
Message-ID: <1998Aug28.150343.1@eisner> (raw)
In-Reply-To: 6s6i11$jla$1@vixen.cso.uiuc.edu

In article <6s6i11$jla$1@vixen.cso.uiuc.edu>, tsmurphy@cs.uiuc.edu (TERENCE MURPHY) writes:
> How do I get the compiler to generate the hello string as a pascal
> string?  Do compilers typically have a command line option to specify
> what kind of strings you can use?  In particular, does gcc?
> 
> It seems that the only semi-portable way to do this would be to compile
> the program with strings constants as writable, and convert each string
> a run-time.  This is a serious, serious kludge, and I'd hardly say that
> this is a "perfectly free" task (especially since it is likely that
> many compilers do not even support writable string constants, so it's
> non-portable, which defeats the main purpose of C).

As has been mentioned, the definition of a descriptor structure could
be encapsulated in a macro and would result in painless generation of
suitable string constants; and with an optimizing compiler the strlen()
might actually be optimized away so that the run-time cost would be
minimal.

The effort involved in generating alternative string constants, even
without this, turns out to be minor compared to writing and maintaining
replacements to all the run-time routines that currently work with
null-terminated strings only.

May I suggest C++, or, better yet, Java, as the only reasonable way
to write "C" code with safe strings?

--
George Cornelius              cornelius@eisner.decus.org
                              cornelius@mayo.edu



  parent reply	other threads:[~1998-08-28  4:00 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0095000017115526000002L062*@MHS>
     [not found] ` <35E04DF1.1911@world.std.com>
     [not found]   ` <35E09E76.6773@earthlink.net>
1998-08-23  4:00     ` Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Terry C. Shannon
1998-08-23  4:00       ` Glenn C. Everhart
1998-08-24  4:00         ` Paul Sture
1998-08-25  4:00           ` Gregg E Economou
1998-08-25  4:00             ` Jordan Henderson
1998-08-26  4:00               ` Bob Koehler
     [not found]                 ` <6s910k$2bo$1@Starbase.NeoSoft.COM>
     [not found]                   ` <35e833be.0@news.wizvax.net>
1998-08-29  4:00                     ` Jordan Henderson
1998-08-30  4:00                       ` John Wilson
1998-08-30  4:00                         ` Lawrence Kirby
1998-08-30  4:00                           ` JF Mezei
1998-08-30  4:00                             ` Martin Ambuhl
1998-08-31  4:00                             ` Michael Rubenstein
     [not found]                             ` <6scur7$qtk@bgtnsc02.wo <35EA0E22.C59E9476@videotron.ca>
1998-08-31  4:00                               ` Will Rose
1998-08-31  4:00                             ` Craig Franck
1998-08-30  4:00                               ` JF Mezei
1998-08-31  4:00                                 ` firewind
1998-08-30  4:00                         ` JF Mezei
1998-08-30  4:00                           ` Chris Torek
1998-08-31  4:00                             ` Gregg E Economou
1998-08-31  4:00                               ` Chris Torek
1998-09-04  4:00                         ` Thor Lancelot Simon
1998-08-30  4:00                       ` Gregg E Economou
1998-08-30  4:00                         ` K&R fight over ketchup (was: Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA ) Clint Comes
1998-08-31  4:00                           ` Bob Koehler
1998-09-05  4:00                             ` Gregg E Economou
1998-09-05  4:00                       ` Compaq prefers Alpha over Merced! BUT OF COURSE, ALPHA * Peter da Silva
1998-09-05  4:00                         ` Jordan Henderson
1998-09-07  4:00                           ` Peter da Silva
1998-09-07  4:00                             ` Jordan Henderson
1998-09-07  4:00                               ` Peter da Silva
1998-09-07  4:00                                 ` Jordan Henderson
1998-09-08  4:00                                   ` JF Mezei
1998-09-08  4:00                                   ` Peter da Silva
1998-09-08  4:00                                     ` Peter da Silva
     [not found]                                     ` <6t2im5$mke@espresso.cafe.net>
1998-09-08  4:00                                       ` Peter da Silva
1998-09-08  4:00                                   ` Tim Shoppa
     [not found]                                     ` <6t4cui$hfu@espresso.cafe.net>
1998-09-09  4:00                                       ` Tim Shoppa
1998-09-08  4:00                                         ` JF Mezei
1998-09-09  4:00                                         ` Dan Pop
1998-09-09  4:00                                           ` Peter da Silva
1998-09-08  4:00                                 ` Dan Pop
1998-09-08  4:00                                   ` Peter da Silva
1998-09-08  4:00                                     ` Dan Pop
1998-09-07  4:00                               ` Dan Pop
1998-09-07  4:00                               ` Richard Stamp
1998-08-29  4:00                   ` Gregg E Economou
1998-08-30  4:00                     ` Jay Maynard
1998-08-25  4:00             ` John Wilson
1998-08-26  4:00               ` Gregg E Economou
1998-08-27  4:00                 ` John Wilson
1998-08-26  4:00             ` Bob Koehler
1998-08-27  4:00               ` Peter da Silva
1998-08-31  4:00                 ` Boris
1998-08-27  4:00               ` Thor Lancelot Simon
1998-08-28  4:00                 ` TERENCE MURPHY
1998-08-28  4:00                   ` Monty Brandenberg
1998-08-28  4:00                   ` Greg Thomas
1998-08-29  4:00                     ` mathog
1998-09-01  4:00                       ` Greg Thomas
1998-08-28  4:00                   ` George Cornelius [this message]
1998-08-29  4:00                   ` Gregg E Economou
1998-09-05  4:00                   ` Peter da Silva
1998-08-28  4:00                 ` Bob Koehler
1998-09-05  4:00                   ` Peter da Silva
1998-09-08  4:00                     ` Carl Perkins
1998-08-31  4:00                 ` Boris
1998-08-26  4:00             ` Paul Sture
1998-08-27  4:00               ` Gregg E Economou
1998-08-28  4:00                 ` Paul Sture
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox