Issue 120269
Summary Pragma message treated as a warning (Windows, clang-cl 18.1.8)
Labels
Assignees
Reporter askebv
    `first.cpp`:
```
#pragma message("Hi compiler!")
int main(void) { }
```

`build.bat`:
```
@echo off
REM Minimal test:
set LinkerFlags=-opt:ref -incremental:no
clang-cl "first.cpp" -o test.exe /link %LinkerFlags%

REM My actual settings where I need it to not be a warning:

REM set ClangCompilerFlags=-g -arch:AVX2 -fdiagnostics-absolute-paths -Wno-writable-strings -Wno-unused-variable -Wno-unused-parameter -Wno-unused-command-line-argument -Wno-unused-function
REM clang-cl -W4 -WX "first.cpp" -o test.exe /link %LinkerFlags%
```

**Output:**
```
first.cpp(1,9): warning: Hi compiler [-W#pragma-messages]
    1 | #pragma message("Hi compiler!")
      | ^
1 warning generated.
```
**Expected Output:**
```Hi compiler!```

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

Reply via email to