Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Viewed less than a minute ago

cQnKun8cc6wRT0GY

C gcc 12.1.0

Created at 1 minute ago

Created by anonymous

Author

anonymous

1 minute ago

Language

C

Compiler

gcc 12.1.0

Options
Compiler Default
no pedantic
Raw compiler options
-Wall -Werror
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D

Author

anonymous

1 minute ago

›
9
1
2
3
4
5
6
7
8
#include <stdio.h>
#include <stdlib.h>

int main(){

char x = 'a';
printf("%s", x); //Error cause i'm using %s for a char
}
$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'main':
prog.c:7:14: error: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Werror=format=]
    7 |     printf("%s", x);   //Error cause i'm using %s for a char
      |             ~^   ~
      |              |   |
      |              |   int
      |              char *
      |             %d
cc1: all warnings being treated as errors
Exit Code:
1
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D