9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] C compiler and junk mail
@ 2001-03-05 23:17 Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2001-03-05 23:17 UTC (permalink / raw)
  To: 9fans

If you add the following to /sys/src/cmd/cc/lex.c,
it will pass -+ through to the invoked cpp:

			av[0] = CPP;
			i = 1;
>>>			if(debug['+']) {
>>>				sprint(opt, "-+");
>>>				av[i++] = strdup(opt);
>>>			}
			for(c = 0; c < ndef; c++) {
				sprint(opt, "-D%s", defs[c]);
				av[i++] = strdup(opt);
			}

Then you can use 8c -p+, etc.  I added this back in
January to solve exactly the problem you describe.
It will make it out for real when we next do a release.

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] C compiler and junk mail
@ 2001-03-02 20:41 dmr
  0 siblings, 0 replies; 5+ messages in thread
From: dmr @ 2001-03-02 20:41 UTC (permalink / raw)
  To: 9fans

> If you really care, use 8c -p to invoke a strict ANSI preprocessor.

But this won't deal with // either, except with the -+ option
(which -p doesn't generate).  You need to run cpp in
a pipeline.

	Dennis


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] C compiler and junk mail
@ 2001-03-02 19:55 rob pike
  0 siblings, 0 replies; 5+ messages in thread
From: rob pike @ 2001-03-02 19:55 UTC (permalink / raw)
  To: 9fans

	1)  I sent a mild complaint earlier about how the 2nd edition C
	compiler fails to remove // type comments from #define statements.
	This caused me some grief when importing code into plan 9.
	Is this an over sight in the implementation or leaving these comments
	in place part of the language specifications?

Well, first, those are not ANSI C comments. They may be in C99.
But they were added to the Plan 9 compilers because some people
prefer them.

The real problem here is that the Plan 9 compiler remove comments
at a slightly different point in the processing than the ANSI standard
suggests, so comments on #include and #define lines can cause trouble.
If you really care, use 8c -p to invoke a strict ANSI preprocessor.

-rob



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] C compiler and junk mail
  2001-03-02 17:45 ed
@ 2001-03-02 18:28 ` Scott Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Schwartz @ 2001-03-02 18:28 UTC (permalink / raw)
  To: 9fans

> I thought this was a moderated list. Am I wrong?

The usenet->mail direction is moderated, but the other direction isn't.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9fans] C compiler and junk mail
@ 2001-03-02 17:45 ed
  2001-03-02 18:28 ` Scott Schwartz
  0 siblings, 1 reply; 5+ messages in thread
From: ed @ 2001-03-02 17:45 UTC (permalink / raw)
  To: 9fans

1)  I sent a mild complaint earlier about how the 2nd edition C
compiler fails to remove // type comments from #define statements.
This caused me some grief when importing code into plan 9.
Is this an over sight in the implementation or leaving these comments
in place part of the language specifications?

2)  Occasionally I get junk mail from 9fans, e.g.

	From 9fans-admin@cse.psu.edu  Wed Feb 14 02:20:17 2001
Return-Path: <9fans-admin@cse.psu.edu>
Received: from mail.cse.psu.edu (postfix@psuvax1.cse.psu.edu [130.203.4.6])
        by aspen.cs.unr.edu (8.9.2/8.9.2) with ESMTP id CAA18146
        for <ed@cs.unr.edu>; Wed, 14 Feb 2001 02:20:16 -0800 (PST)
Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6])
        by mail.cse.psu.edu (CSE Mail Server) with ESMTP
        id B0E04199D5; Wed, 14 Feb 2001 05:20:11 -0500 (EST)
Received: from g04.syd.iprimus.net.au (g04.syd.iprimus.net.au [203.134.65.6])
        by mail.cse.psu.edu (CSE Mail Server) with SMTP id 68AC8199D5
        for <9fans@cse.psu.edu>; Wed, 14 Feb 2001 05:19:50 -0500 (EST)
Received: (qmail 16404 invoked from network); 14 Feb 2001 10:20:14 -0000
Received: from unknown (HELO kdhbooks.com) (203.134.133.16)
  by g04.syd.iprimus.net.au with SMTP; 14 Feb 2001 10:20:14 -0000
From: "e-Publisher's Weekly" <admin@kdhbooks.com>

...

I thought this was a moderated list. Am I wrong?

ed wishart



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-03-05 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-05 23:17 [9fans] C compiler and junk mail Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-03-02 20:41 dmr
2001-03-02 19:55 rob pike
2001-03-02 17:45 ed
2001-03-02 18:28 ` Scott Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).