Re: PREfast: Different outcome if compiled with or without?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ray Trent (ratrent_at_nospam.nospam)
Date: 02/18/05


Date: Fri, 18 Feb 2005 13:35:34 -0800

What's the error message?

Spiro Trikaliotis wrote:
> Hello,
>
> I just had a somehow unexpected result: I compiled a driver which
> compiles perfectly ("build -cZ") with PREfast (driver specific rules),
> that is, "prefast build -cZ".
>
> Somehow, the compilation breaks if I use prefast. I tracked it down to
> the following statement:
>
> signal(SIGINT, reset);
>
> Somewhere else, there is the following function definition:
>
> static void ARCH_SIGNALDECL reset(int dummy)
> { ... }
>
> and, in some header file, there is:
>
> #ifdef WIN32
> #define ARCH_LINUX_WINDOWS( _linux, _windows) _windows
> #else
> #define ARCH_LINUX_WINDOWS( _linux, _windows) _linux
> #endif
> #define ARCH_SIGNALDECL ARCH_LINUX_WINDOWS(/* no decl needed */, __cdecl)
>
>
> Yes, I AM sure that this header file is included before. ARCH_SIGNALDECL
> is not defined anywhere else, but the compiler does not complain about
> ARCH_SIGNALDECL not defined, but about not being able to convert reset()
> from __stdcall to __cdecl.
>
> Now, if I replace
>
> static void ARCH_SIGNALDECL reset(int dummy)
> { ... }
>
> through
>
> static void __cdecl reset(int dummy)
> { ... }
>
> everything works fine.
>
>
> Well, the most interesting part is: If I do NOT use prefast, even the
> first version works perfectly. It works perfectly, too, if I replace
>
> #define ARCH_SIGNALDECL ARCH_LINUX_WINDOWS(__cdecl, __cdecl)
>
> Now, I ask myself what changes PREfast does to the compiler?
>
> I do not understand why this compiles perfectly without PREfast, but
> does not compile with PREfast.
>
> Ah, I forgot: This happens with PREfast 1.5.2402 (2K3 SP1 RC1 DDK,
> 3790.1289), as well as with 2K3 DDK (3790) - in the latter case,
> obviously without the driver specific rules.
>
> Can anybody give me a good hint on what is going on?
>
> Regards,
> Spiro.
>

-- 
../ray\..


Relevant Pages

  • Re: PREfast and #include <cstdio> and such
    ... Prefast seems to use a modified version of the C++ compiler, ... > (converted to a makefile project for this purpose...pheow!), ... > sipchannel.cpp: warning 98102: Error Processing File ...
    (microsoft.public.development.device.drivers)
  • lucent modem driver compilation failure
    ... I'm trying to compile an installable module for my internal modem ... and driver work as they were fully functional under RH7.3. ... 00:07.2 USB Controller: VIA Technologies, ... If not present use the ltmodem-8.22a5.tar.gz compiler kit. ...
    (linux.redhat.misc)
  • lucent modem driver compilation failure
    ... I'm trying to compile an installable module for my internal modem ... and driver work as they were fully functional under RH7.3. ... 00:07.2 USB Controller: VIA Technologies, ... If not present use the ltmodem-8.22a5.tar.gz compiler kit. ...
    (comp.os.linux.hardware)
  • Re: Microfocus Netexpress question : COBSQL vs openESQL
    ... >couldnt connect with the oracle database specified in the program. ... It may be missing an ODBC driver and/or data source. ... You also need an entry for the data source in tnsnames.ora. ... precompiler directives to the precompiler and compiler directives to ...
    (comp.lang.cobol)
  • Re: Build device driver using Microsoft Visual C++ 2005
    ... If its true that SoftIce has been flushed then driver development just got ... since SoftIce has been flushed. ... anything other than the DDK compiler to build a driver. ... on your driver and then come back and talk about PDB files. ...
    (microsoft.public.development.device.drivers)