Re: Opinion on coding style.
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Fri, 21 Dec 2007 13:15:15 -0800
That should be as simple as including a #pragma warning(disable:n)
in the appropriate header file. Don't want the warning disabled -
then don't use the problematic class (CString). That can be easily
controlled with a macro.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Leo V" <LeoV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:us8KxkARIHA.5136@xxxxxxxxxxxxxxxxxxxxxxx
"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:a5amm3llnvo6nmtgherg6k2edmoikc7co0@xxxxxxxxxx
On Thu, 20 Dec 2007 18:36:27 -0800, "Leo V"
<LeoV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Interesting. I was thinking about the possibility of proposing an
operator(...) language extension
so you could define what your class should return when used in a variable
argument list.
That might be workable; if you're really interested, see what the people
in
comp.lang.c++.moderated have to say.
Thanks, I might do that and see what they think.
You can write your own functions whose last parameter is the ellipsis,
but
enabling the passing of non-POD types would indeed require extending the
language. I'd be happy if the compiler would just emit a warning based on
the language as it currently exists. Heck, I wasn't even asking for it to
validate printf format specifiers; the test is much simpler than that,
and
it applies to all ellipsis usage.
Wow, I agree. I mean, if it really isn't valid to pass non-POD types over
a var_arg (they just get treated as PVOIDs), then a warning seems
perfectly reasonable. MS is probably not in a hurry to do that because of
the work they go through to guarantee that CString will work in that
scenario.
--
Doug Harrison
Visual C++ MVP
.
- References:
- Opinion on coding style.
- From: Leo V
- Re: Opinion on coding style.
- From: Doug Harrison [MVP]
- Re: Opinion on coding style.
- From: Leo V
- Re: Opinion on coding style.
- From: Doug Harrison [MVP]
- Re: Opinion on coding style.
- From: Leo V
- Re: Opinion on coding style.
- From: Doug Harrison [MVP]
- Re: Opinion on coding style.
- From: Leo V
- Opinion on coding style.
- Prev by Date: Re: Opinion on coding style.
- Next by Date: Re: Opinion on coding style.
- Previous by thread: Re: Opinion on coding style.
- Next by thread: Re: Opinion on coding style.
- Index(es):
Relevant Pages
|