[comp.sys.amiga.tech] SAS C 5.10 and nested comments

chanson@nyx.UUCP (chris hanson) (09/12/90)

  I am getting ready to call SAS about this, but thought that perhaps I
should see if anyone else had this problem, and/or a solution. If someone
does, please reply via mail, and I will summarize.
 
   The problem in question: I am using the SASCOPTIONS (also known by its
'Options' icon in your source directory) program to set my compiler
options before compiling with the 'Build' icon (which calls LMK with an
options file). The problem occurs when I attempt to use the nested
comments feature by toggling its checkmark in the Options program. (Nice
options program, THX SAS!) It sets and such fine, but when I go to
Build/LMK, the compiler tosses me a message to the effect of 
"*** Unrecognized -c option: -cn" (cut, live, just now, on the fly, via
Snap 1.4 ;). If I recall (I use the nested comment feature alot, love to
comment out a block o' code for testing), in 5.0x, the nested comments
option was -cc, not -cn. This may have changed in 5.1, but I wouldn't
know, there was piddling little documentation, what about 30 pages, mostly
a replacement for every page that had the word "Lattice" on it in bigger
than 8 points? 
 
  Anyone else run into this? If you go to try it yourself, the nested
comments option is on the 'Advanced Options' window.
 
   Chris - Xenon
(I work for Progressive Peripherals & Software Tech support, but please
don't hold that against me. It just pays. Besides, they don't know/care
what I do after 6 mountain time. ;)

ggk@tirith.UUCP (Gregory Kritsch) (09/12/90)

In a message posted on 12 Sep 90 04:20:24 GMT,
chanson@nyx.UUCP (chris hanson) wrote:
ch>Snap 1.4 ;). If I recall (I use the nested comment feature alot, love to
ch>comment out a block o' code for testing), in 5.0x, the nested comments

Yeah, I know what you mean.  Except that I've never turned on the nested
comments bit.  I found it far easier to just do things like

#ifdef DONT_DEFINE_ME
...
#endif

Sometimes, I use more descriptive names, of course. :-)
---
  Gregory Kritsch
    Fido:  1:221/208.11110  [1:163/109.30]
    UUCP:  xenitec!tirith!ggk

rick@tmiuv0.uucp (09/14/90)

In article <2076@nyx.UUCP>, chanson@nyx.UUCP (chris hanson) writes:
[lots deleted]
> [...] If I recall (I use the nested comment feature alot, love to
> comment out a block o' code for testing), in 5.0x, the nested comments
> option was -cc, not -cn.

I dunno about SAS/C, but since nested comments aren't always supported (the
ANSI standard, in fact, explicitly says that comments DON'T NEST (section
3.1.9 and footnote 26, ANSI standard X3.159-1989)), the better way to do
this is:

    #if 0
      [stuff to be ignored]
    #endif

You're guaranteed of ANSI compatibility this way, and it'll compile on any
machine.

----------------------------------------------------------------------------
[- O] Rick Stevens, Technology Marketing Incorporated
  ?   EMail: uunet!zardoz!tmiuv0!rick -or- uunet!zardoz!xyclone!sysop
  V   CIS: 75006,1355 (75006.1355@compuserve.com from Internet)
      (Opinions are mine.  No one listens to me here anyway.)

"Lead, follow, or get the h*ll out of the way!"
----------------------------------------------------------------------------