[cfe-dev] Invalid token error
Douglas Gregor
dgregor at apple.com
Tue Mar 10 08:41:25 PDT 2009
On Mar 9, 2009, at 10:11 PM, रजनीश wrote:
>
> Shouldn't Clang give a warning of invalid data type (ssize_t)
> right now it just gives invalid token error and underline of token is
> not there either.
> Caret points to plat_read. Is that correct?
>
> token.c:4:9: error: invalid token after top level declarator
> ssize_t plat_read(int fd, void *buf, size_t count);
> ^
We could do better here. Two identifiers in a row typically means that
the first is a type. Could you file a bug at llvm.org/bugs?
> plus there is 'int' that is printed on plat_close warning right below
> caret symbol
> which seem to be not needed.
>
> token.c:6:1: warning: type specifier missing, defaults to 'int'
> plat_close(int fd)
> ^
> int
This code is using the implicit int feature of C90, which is not
available in C99. Inserting "int" where the caret indicates will
suppress the warning and get this code a little closer to C99
conformance.
- Doug
More information about the cfe-dev
mailing list