Issue 114535
Summary Syntax error when compiling C example with 32-bit address space
Labels new issue
Assignees
Reporter ararmine
    Clang issues a syntax error for the following C example example: 
Tried with **x86-64 clang 19.1.0** version.

1. cat example.c
`typedef int (*__ptr32 fptr1)();
typedef int (* __ptr32 fptr5)(fptr1);
int f5 (int (int()));
int f5 (fptr5 fp)
{
  return 5;
}`

2. clang example.c -fms-extensions
```
example.c:4:5: error: conflicting types for 'f5'
int f5 (fptr5 fp)
 ^
example.c:3:5: note: previous declaration is here
int f5 (int (int()));
    ^
1 error generated.
```

NOTE: When compiling the example as a C++ source, there is no error.

x64 MSVC v.19 gives a warning for the C example:
example.c
<source>(4): warning C4028: formal parameter 1 different from declaration

I am not sure if this a bug. 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to