Re: Opinion on coding style.



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




.



Relevant Pages

  • Re: Static Class Constants (VB 2005)
    ... this is a change in the VB.NET language and you will be force to change ... > with a single button, I get the error "Access of shared member, constant ... >>> Inside the class MyClass ... >>> because I didn't see the warning. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB Compiler Warnings & other woes ...
    ... >> In this case VB Compiler does not generate any warning. ... >> the VB developers use the language as a toy language. ... Microsoft haven't made it a neccessity so that all of those applications ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Why does this code work?
    ... warning or even an error IIRC in VS 2005...) ... When I saw that you said "prevented from" than I did disagree and I did not ... basic of the arguments of Jon, OHM and Armin about the use of the code. ... If that would be the point, every language ...
    (microsoft.public.dotnet.general)
  • Re: NTFS encryption on second drive inaccesible
    ... What I would like to see is some warning wording in any publicity articles ... > MVP (Windows Platform) Associate Expert ...
    (microsoft.public.windowsxp.security_admin)
  • Problems running TeXniCcenter with wine
    ... Warning: Language 'en_DK' was not recognized, defaulting to 'en_US'. ... to set the screen resolution and remove the "Resolution" entry in the config ...
    (comp.unix.programmer)