Skip to content

Syntax error when compiling C example with 32-bit address space #114535

@ararmine

Description

@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;
}
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions