[cfe-dev] implicit int rule for c89
Rong, Hongbo
hongbo.rong at intel.com
Sun Dec 14 22:34:56 PST 2014
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141215/d7de36bb/attachment.html>
More information about the cfe-dev
mailing list