🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by JdeBP Sat, 11 Nov 1995 06:08
Re: New treatment of 'for (int i ...'
#2515
Author: JdeBP
Date: Sat, 11 Nov 1995 06:08
26 lines
1554 bytes
In article <9531318.2076@mulga.cs.mu.OZ.AU> you wrote:
: There is a neat hack which gives you the new behaviour with old compilers:

: 	#ifdef USE_HACK_FOR_NEW_FOR_SCOPE
: 	#define for(x) if (0) ; else for(x)
: 	#endif

: (Did I get that right this time?)

No.  (-:

( Hint : you may want to consult the substitution rules for function-like
  macros again. ) 

I've started to use this macro, and I can report that it has one serious
drawback.  The compiler spits out reams of useless "a constant was used 
as the controlling expression in an if statement" warnings.  (-:

Oh yes ... it also tells me that my macro overrides the keyword "for".

I wish I was allowed to use the compiler that has the facility to
selectively disable warnings ...
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads