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: How do variables get synthesized in this case?
    ... VHDL is a simulation language. ... which has the extra state changes of signals. ... a warning, but would not change the functioning of the code. ... such signal oscillation for power saving reasons, ...
    (comp.lang.vhdl)
  • Re: C++0x: Scaling up on weak foundations?
    ... in defining a new language for new development, ... Why have (excluding pointers) more than 1 name for the same size ... No implicit conversions to integers. ... * or perhaps with warning, ...
    (comp.lang.misc)
  • Re: Thats a shame!!
    ... The Real Truth http://pcbutts1-therealtruth.blogspot.com/ ... *WARNING* Do NOT follow any advice given by the people listed below. ... >> Well I am using the MS server which only MS employees have access to. ... No fake MVP here. ...
    (microsoft.public.windowsxp.newusers)
  • Re: zsh, ssh und Umlaute
    ... da es Fehler von setlocale berichtet: ... perl: warning: Please check that your locale settings: ... LANGUAGE =, ...
    (de.comp.os.unix.shell)
  • 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)