[cfe-dev] implicit int rule for c89

Dennis Luehring dl.soluz at gmx.net
Sun Dec 14 22:47:13 PST 2014


its not very helpfull to ask micro-questions - give a more fully 
description of you're trying to archive in the end - not what you think 
whats needed to get to the point
would help alot

Am 15.12.2014 um 07:34 schrieb Rong, Hongbo:
> Thanks! Are you aware of any rule (or code correction in clang) that can automatically add a type (or correct a type) to a variable? Any example and command line?
> From: James Dennett [mailto:james.dennett at gmail.com]
> Sent: Sunday, December 14, 2014 10:32 PM
> To: Rong, Hongbo
> Cc: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] implicit int rule for c89
>
> On Sun, Dec 14, 2014 at 10:21 PM, Rong, Hongbo <hongbo.rong at intel.com<mailto:hongbo.rong at intel.com>> wrote:
> b.c:
> int main() {
>    a = 1;
>    return a;
> }
>
> clang.exe -std=c89 b.c
> b.c:2:3: error: use of undeclared identifier 'a'
>    a = 1;
>    ^
> b.c:3:10: error: use of undeclared identifier 'a'
>    return a;
>           ^
> 2 errors generated.
>
> For c89, why variable a is not made as an implicit int?
>
>
> Because that's not what C89 says.  "implicit int" was for functions, not variables.
>
> -- James
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list