| 1 |
@echo off |
| 2 |
|
| 3 |
set file=file1.c |
| 4 |
|
| 5 |
:: Run clang |
| 6 |
clang -pedantic -Wall -O0 "%file%" >out.txt 2>&1 |
| 7 |
if %errorlevel% neq 0 exit /B 1 |
| 8 |
|
| 9 |
findstr /c:"incompatible redeclaration" out.txt > NUL 2>&1 || ^ |
| 10 |
findstr /c:"ordered comparison between pointer" out.txt > NUL 2>&1 || ^ |
| 11 |
findstr /c:"eliding middle term" out.txt > NUL 2>&1 || ^ |
| 12 |
findstr /c:"end of non-void function" out.txt > NUL 2>&1 || ^ |
| 13 |
findstr /c:"invalid in C99" out.txt > NUL 2>&1 || ^ |
| 14 |
findstr /c:"specifies type" out.txt > NUL 2>&1 || ^ |
| 15 |
findstr /c:"should return a value" out.txt > NUL 2>&1 || ^ |
| 16 |
findstr /c:"too few argument" out.txt > NUL 2>&1 || ^ |
| 17 |
findstr /c:"too many argument" out.txt > NUL 2>&1 || ^ |
| 18 |
findstr /c:"return type of 'main" out.txt > NUL 2>&1 || ^ |
| 19 |
findstr /c:"uninitialized" out.txt > NUL 2>&1 || ^ |
| 20 |
findstr /c:"incompatible pointer to" out.txt > NUL 2>&1 || ^ |
| 21 |
findstr /c:"incompatible integer to" out.txt > NUL 2>&1 || ^ |
| 22 |
findstr /c:"type specifier missing" out.txt > NUL 2>&1 |
| 23 |
if %errorlevel% equ 0 exit /B 1 |
| 24 |
|
| 25 |
gcc -c -Wall -Wextra -O "%file%" >outa.txt 2>&1 |
| 26 |
if %errorlevel% neq 0 exit /B 1 |
| 27 |
|
| 28 |
findstr /c:"uninitialized" outa.txt > NUL 2>&1 || ^ |
| 29 |
findstr /c:"control reaches end" outa.txt > NUL 2>&1 || ^ |
| 30 |
findstr /c:"no semicolon at end" outa.txt > NUL 2>&1 || ^ |
| 31 |
findstr /c:"incompatible pointer" outa.txt > NUL 2>&1 || ^ |
| 32 |
findstr /c:"cast from pointer to integer" outa.txt > NUL 2>&1 || ^ |
| 33 |
findstr /c:"ordered comparison of pointer with integer" outa.txt > NUL 2>&1 || ^ |
| 34 |
findstr /c:"declaration does not declare anything" outa.txt > NUL 2>&1 || ^ |
| 35 |
findstr /c:"expects type" outa.txt > NUL 2>&1 || ^ |
| 36 |
findstr /c:"assumed to have one element" outa.txt > NUL 2>&1 || ^ |
| 37 |
findstr /c:"division by zero" outa.txt > NUL 2>&1 || ^ |
| 38 |
findstr /c:"pointer from integer" outa.txt > NUL 2>&1 || ^ |
| 39 |
findstr /c:"incompatible implicit" outa.txt > NUL 2>&1 || ^ |
| 40 |
findstr /c:"excess elements in struct initializer" outa.txt > NUL 2>&1 || ^ |
| 41 |
findstr /c:"comparison between pointer and integer" outa.txt > NUL 2>&1 |
| 42 |
if %errorlevel% equ 0 exit /B 1 |
| 43 |
|
| 44 |
findstr /c:"goto" "%file%" > NUL 2>&1 |
| 45 |
if %errorlevel% neq 0 exit /B 1 |
| 46 |
|
| 47 |
:: Variant is interesting |
| 48 |
exit /B 0 |