Illegal and unenforced or just illegal?

 

When will this be a problem? I'm curious to any crafty methods anyone else
can suggest to do this. It's hard to keep the code invasion to a minimum.

 

From: liam mail [mailto:liam.l...@googlemail.com] 
Sent: November-22-09 12:03 PM
To: UnitTest++ development and use
Subject: Re: [unittest-cpp-devel] Testing your privates

 

 

2009/11/22 Clark Gaebel <cg.wowus...@gmail.com>

It is via a keyword redefinition.

 

#define private public

#define protected public

 

Can someone try this on a non-Microsoft compiler (namely GCC and Intel) to
see if this generates any errors/warnings? It's working fine for me with
VS2008.

 

From: liam mail [mailto:liam.l...@googlemail.com] 
Sent: November-21-09 11:17 PM


To: UnitTest++ development and use
Subject: Re: [unittest-cpp-devel] Testing your privates

 

 

2009/11/22 Clark Gaebel <cg.wowus...@gmail.com>

Can you think of any potential problems in redefining private and protected
to public? This patch is really quite trivial but I'm afraid it has the
potential to create nefarious errors. It's worked fine for me so far... but
I find there's always an edge case...
 

How are you doing it? This has been asked and I do not know if I have missed
the answer here.
If you are using the preprocessor to redefine then yes there is a major
problem, it is illegal to define a language keyword. If on the other hand
you are doing this some other way and I have misunderstood please enlighten
me.
Thanks

 

__________ Information from ESET Smart Security, version of virus signature
database 4627 (20091121) __________

 

The message was checked by ESET Smart Security.

 

http://www.eset.com


----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
unittest-cpp-devel mailing list
unittest-cpp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel

It has nothing to do with giving a warning or error on one specific
implementation of C++, as I have said it is illegal.
If the program declares or defines a name in a context where it is reserved,
other than as explicitly allowed
by this clause, the behavior is undefined.
17.4.3.1.1 Macro names
Each name defined as a macro in a header is reserved to the implementation
for any use if the translation
unit includes the header.
A translation unit that includes a header shall not contain any macros that
define names declared or defined
in that header. Nor shall such a translation unit define macros for names
lexically identical to keywords.

 

__________ Information from ESET Smart Security, version of virus signature
database 4628 (20091122) __________

 

The message was checked by ESET Smart Security.

 

http://www.eset.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
unittest-cpp-devel mailing list
unittest-cpp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unittest-cpp-devel

Reply via email to