Issue 137846
Summary Clang 21 accepts invalid # 0 preprocessor lines leading to undefined behavior at compile time
Labels clang
Assignees
Reporter mariete1223
    ## Summary

Clang 21 accepts invalid standalone # 0 preprocessor lines in C source files without emitting an error or a warning. When compiled, the program exhibits undefined behavior (e.g., prints unlimited spaces or crashes), despite the code being syntactically invalid.

## Program 

```
uint32_t square(uint32_t x)
# 0
# 0
```

## To reproduce Quickly

https://gcc.godbolt.org/z/c1daT34v6

It gets:

[Truncated]
Compiler returned: 143

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to