DDK's C compiler ought to conform a bit better

Discussion in 'Windows Vista Drivers' started by Norman Diamond, Jul 11, 2005.

  1. C standard page 81 footnote 85:
    Of course I would prefer if the standard would state that rule normatively
    instead of advisorily, but the committee's intention is clear.

    Page 91 section 6.5.16 applies to all kinds of assignment operators:
    Conforming C implementations are required to issue at least one diagnostic
    when given a translation unit containing the following:
    ULONG x = 8; // OK
    (ULONG)x |= 3; // violation of a constraint

    OK, sure the DDK's C compiler isn't a real C compiler. But why ignore
    something like this? For example suppose the declaration of x were actually
    a ULONG_PTR and just happened by accident to map onto a ULONG, while the
    cast is still a ULONG? As a matter of fact that's exactly the situation
    where I saw it. Why not issue a warning?
     
    Norman Diamond, Jul 11, 2005
    #1
    1. Advertisements

  2. Norman Diamond

    Calvin Guan Guest

    [snip]

    Dude, it's not the problem of the compiler, it's the build environment. You
    will get C4213 if you set /W4 or higher (default is W3 for DDK build env).
    Apart from that, there's is a "force include" header turns selected
    WRN/ERR on/off INDIVIDUALLY.
    THAT'S WHY I PERSONALLY REQUIRE ALL DRIVERS I'VE WRITTEN FROM SCRATCH HAVE
    TO BE /WALL CLEAR IN ADDITION TO PRE/DRVFAST.
     
    Calvin Guan, Jul 11, 2005
    #2
    1. Advertisements

  3. Thank you for teaching me this. Now it shouldn't take long to figure out
    where to set it.
    You're screaming at the choir. Did you notice I mentioned the situation
    where I _saw_ it not where I _wrote_ it? Would you like to try guessing
    which company you need to scream at?
     
    Norman Diamond, Jul 12, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.