Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Incomplete function macro call should be an error #472

Open
jyn514 opened this issue Jun 7, 2020 · 0 comments
Open

Incomplete function macro call should be an error #472

jyn514 opened this issue Jun 7, 2020 · 0 comments
Labels
bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection)

Comments

@jyn514
Copy link
Owner

jyn514 commented Jun 7, 2020

Expected behavior

Function macros which do not have a terminating ) should give an error. Instead they are silently discarded.

$ clang -E replace.c 
replace.c:2:2: error: unterminated function-like macro invocation
 f (
 ^

Code

#define f(a) a
 f (

http://port70.net/~nsz/c/c11/n1570.html#6.10.3p4:

There shall exist a ) preprocessing token that terminates the invocation.

@jyn514 jyn514 added bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection) labels Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working preprocessor Issue in the preprocessor (probably cycle detection)
Projects
None yet
Development

No branches or pull requests

1 participant