Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: gcc_centric C code Date: Wed, 25 Apr 2018 18:28:44 -0700 Organization: None to speak of Lines: 32 Message-ID: References: <87tvrzpa32.fsf@bsb.me.uk> <87in8forv8.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: h2725194.stratoserver.net; posting-host="751013466cf4d83a736ec69fbb9af6e9"; logging-data="20252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bx5MFJlUvDKY9ozbaW1e/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:rbKoGDvSmRhQXGhte1ac7kim3tk= sha1:GbPbP9HO9fgBiwme0CFkLNLRoF0= Xref: csiph.com comp.lang.c:129762 bartc writes: [...] > Using Pellec C on the same file: > > c:\ps\src\lib\xpost_compat.c(217): error #2168: Operands of '=' have > incompatible types 'unsigned long long int' and 'void *'. > > Same error on lccwin32, and similar on MSVC. Line 217 is: > > HCRYPTPROV provider = NULL; > > If HCRYPTPROV is unsigned long long, then this is an error because the > RHS is a void*, and the LHS is an int. > > In gcc apparently this is normally just a warning, but in this context, > I didn't even get that for some reason. NULL can be of type void* or of any integer type. If the standard headers have #define NULL 0 then unsigned long long provider = NULL; is legal (but a bad idea, since NULL should be used only in a pointer context). [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"