Re: PREfast: Different outcome if compiled with or without?
From: Ray Trent (ratrent_at_nospam.nospam)
Date: 02/22/05
- Next message: Stephan Wolf [MVP]: "Re: NTFS block allocation policy (Windows XP)"
- Previous message: shawnonline_at_gmail.com: "Re: Q: SetupDi"
- In reply to: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Next in thread: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Reply: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Feb 2005 13:52:33 -0800
Hmmm. Don't see anything obvious unless it's a twitchy difference
between the prefast compiler and the standard one (they aren't exactly
the same compiler IIRC).
Technically speaking, it's not legal to call a macro function and to
fail to pass one of the parameters. Since comments are typically
stripped before macros are expanded, your declaration of ARCH_SIGNALDECL
(as, effectively, "ARCH_LINUX_WIN(,__cdecl)") may have undefined
behavior. The spec is a bit unclear on this point, though, so I could be
misreading it... Also, this may not apply to your actual situation...
Spiro Trikaliotis wrote:
> Hello,
>
> Ray Trent <ratrent@nospam.nospam> schrieb:
>
>
>>What's the error message?
>
>
> A good question. I totally forgot to mention that:
>
> main.c(19) : error C2440: 'function' : cannot convert from 'void
> (__stdcall *)(int)' to 'void (__cdecl *)(int)'
>
> I set up a small sample on
> http://www.trikaliotis.net/download/ddk-prob/prefast-problem.zip
> that shows the behaviour.
>
> Compiling with
> build -cefZ
> , it compiles perfectly.
>
> Running
> prefast build -cefZ
> , you get the above error message.
>
> Replacing
>
> #define ARCH_SIGNALDECL ARCH_LINUX_WINDOWS(__cdecl, __cdecl)
>
> in arch.h, the problem is gone, too.
>
> Does prefast make the compiler "forget" that it is running in WIN32?
> (just kidding)
>
> Regards,
> Spiro.
>
-- ../ray\..
- Next message: Stephan Wolf [MVP]: "Re: NTFS block allocation policy (Windows XP)"
- Previous message: shawnonline_at_gmail.com: "Re: Q: SetupDi"
- In reply to: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Next in thread: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Reply: Spiro Trikaliotis: "Re: PREfast: Different outcome if compiled with or without?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|