0

In compiler trigraphs and digraphs are not replacing by the corresponding single characters. Rather it's giving a warning something like this,

12:26 G:\BIN\cLang\macro2.cpp [Warning] trigraph ??= ignored, use -trigraphs to enable 

I want to know why this type of warning is giving and how can I solve this to use trigraphs and digraphs. In what purposes they were in the language???

NOTE - I want to see how digraphs & trigraphs work, so dont tell me to not to use them because they are obsolete... Thanks Advance

amin__
  • 1,018
  • 3
  • 15
  • 22

2 Answers2

1

The message tells you what to do, when you invoke the compiler add option -trigraphs

SpacedMonkey
  • 2,725
  • 1
  • 16
  • 17
0

Looks similar to the warning I get with gcc.

Compiled without any flags:

$ gcc trigraphs.c 
trigraphs.c:5:10: warning: trigraph ??= ignored, use -trigraphs to enable

So I add the flag suggested by the compiler:

$ gcc -trigraphs trigraphs.c 
$ ./a.out 
a test: #
$

This is my code that I stored in the file trigraphs.c:

#include <stdio.h>

int main(void){
        printf("a test: ??=\n");
        return 0;
}
Lucas
  • 13,679
  • 13
  • 62
  • 94