tool hunt



 DEVELOP > c-Plus-Plus > tool hunt

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Noah Roberts"
Date: 04 Jan 2008 04:27:39 PM
Object: tool hunt
Is there anything that will hunt down c-style casts and replace them
with the appropriate new-style cast?
.

User: "Ivan Vecerina"

Title: Re: tool hunt 04 Jan 2008 08:24:45 PM
"Noah Roberts" <user@example.net> wrote in message
news:flmbsg$a1h$1@aioe.org...
: Is there anything that will hunt down c-style casts and replace them
: with the appropriate new-style cast?
Unfortunately, it pretty much would take a compiler to select the
proper new-style cast -- an automated tool would need to properly
disambiguate the cast from similar constructs, and to be aware
of inheritance etc.
So the best approach I could think of -- if you really care to
"upgrade" the code -- would be to manually go through the list
of C casts (can trigger a warning with various compilers), then
use a set of editor macros to convert to a new-style cast with
minimal keystrokes... no better idea unfortunately.
Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <> http://www.brainbench.com
.
User: "Noah Roberts"

Title: Re: tool hunt 18 Jan 2008 05:10:41 PM
Ivan Vecerina wrote:

would be to manually go through the list
of C casts (can trigger a warning with various compilers)

Anyone know if MSVC has such a warning? I can't find one.
.


User: "Christopher Pisz"

Title: Re: tool hunt 04 Jan 2008 05:04:00 PM
"Noah Roberts" <user@example.net> wrote in message
news:flmbsg$a1h$1@aioe.org...

Is there anything that will hunt down c-style casts and replace them with
the appropriate new-style cast?

I dont know how anything but a compiler would know the differance between
(int *)somevar and foo(int *). I Imagine there are warning levels cause the
compiler to spew warnings about c style casts. At least in VS. I am not sure
about others. You'd have to check the docs.
.

User: "Ioannis Vranos"

Title: Re: tool hunt 04 Jan 2008 08:31:16 PM
Noah Roberts wrote:

Is there anything that will hunt down c-style casts and replace them
with the appropriate new-style cast?

My opinion is, if the code is OK, do not bother to modify the casts. Use
the newest C++ casts in your new code.
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER