There shall be no more than one external definition for each identifier declared with internal linkage
in a translation unit. Moreover, if an identifier declared with internal linkage is used in an expression
there shall be exactly one external definition for the identifier in the translation unit, unless it is:
— part of the operand of a sizeof operator whose result is an integer constant;
— part of the operand of an alignof operator whose result is an integer constant;
— part of the controlling expression of a generic selection;
— part of the expression in a generic association that is not the result expression of its generic
selection;
— or, part of the operand of any typeof operator whose result is not a variably modified type.
Clang incorrectly handles the generic association bullet. Consider:
static void *a(void);
_Generic(0, int : 0, default: a);
Clang diagnoses the mention of a despite that being in an association that is not the result expression. This rejects valid code under -pedantic-errors.
C23 6.9p3 says:
There shall be no more than one external definition for each identifier declared with internal linkage
in a translation unit. Moreover, if an identifier declared with internal linkage is used in an expression
there shall be exactly one external definition for the identifier in the translation unit, unless it is:
— part of the operand of a sizeof operator whose result is an integer constant;
— part of the operand of an alignof operator whose result is an integer constant;
— part of the controlling expression of a generic selection;
— part of the expression in a generic association that is not the result expression of its generic
selection;
— or, part of the operand of any typeof operator whose result is not a variably modified type.
Clang incorrectly handles the generic association bullet. Consider:
```
static void *a(void);
_Generic(0, int : 0, default: a);
```
Clang diagnoses the mention of `a` despite that being in an association that is not the result expression. This rejects valid code under `-pedantic-errors`.
C23 6.9p3 says:
There shall be no more than one external definition for each identifier declared with internal linkage
in a translation unit. Moreover, if an identifier declared with internal linkage is used in an expression
there shall be exactly one external definition for the identifier in the translation unit, unless it is:
— part of the operand of a sizeof operator whose result is an integer constant;
— part of the operand of an alignof operator whose result is an integer constant;
— part of the controlling expression of a generic selection;
— part of the expression in a generic association that is not the result expression of its generic
selection;
— or, part of the operand of any typeof operator whose result is not a variably modified type.
Clang incorrectly handles the generic association bullet. Consider:
```
static void *a(void);
_Generic(0, int : 0, default: a);
```
Clang diagnoses the mention of `a` despite that being in an association that is not the result expression. This rejects valid code under `-pedantic-errors`.
C23 6.9p3 says:
There shall be no more than one external definition for each identifier declared with internal linkage in a translation unit. Moreover, if an identifier declared with internal linkage is used in an expression there shall be exactly one external definition for the identifier in the translation unit, unless it is: — part of the operand of a sizeof operator whose result is an integer constant; — part of the operand of an alignof operator whose result is an integer constant; — part of the controlling expression of a generic selection; — part of the expression in a generic association that is not the result expression of its generic selection; — or, part of the operand of any typeof operator whose result is not a variably modified type.
Clang incorrectly handles the generic association bullet. Consider:
Clang diagnoses the mention of
a
despite that being in an association that is not the result expression. This rejects valid code under-pedantic-errors
.