07-26-2023, 08:36 PM
Code:
#include <stdio.h>
int main(void)
{
??< puts("Hello Folks!"); ??>
}
The above program, when compiled with GCC 4.8.1 with `-Wall` and `-std=c11`, gives the following warning:
source_file.c: In function ‘main’:
source_file.c:8:5: warning: trigraph ??< converted to { [-Wtrigraphs]
??< puts("Hello Folks!"); ??>
^
source_file.c:8:30: warning: trigraph ??> converted to } [-Wtrigraphs]
But when I change the body of `main` to:
<% puts("Hello Folks!"); %>
no warnings are thrown.
So, **Why does the compiler warn me when using trigraphs, but not when using digraphs?**
#include <stdio.h>
int main(void)
{
??< puts("Hello Folks!"); ??>
}
The above program, when compiled with GCC 4.8.1 with `-Wall` and `-std=c11`, gives the following warning:
source_file.c: In function ‘main’:
source_file.c:8:5: warning: trigraph ??< converted to { [-Wtrigraphs]
??< puts("Hello Folks!"); ??>
^
source_file.c:8:30: warning: trigraph ??> converted to } [-Wtrigraphs]
But when I change the body of `main` to:
<% puts("Hello Folks!"); %>
no warnings are thrown.
So, **Why does the compiler warn me when using trigraphs, but not when using digraphs?**