When it is not in ansi mode gcc
is not converting the trigrpah ??=
(length 3) to #
(length 1) which explains the length difference.
If you had not suppressed warnings gcc
would warn that it is ignoring the trigraph in the non ansi mode(see it live):
warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
You can read more about dialect options in the Options Controlling C Dialect section of the gcc
docs. It says the following for -ansi
:
[...] It also enables the undesirable and rarely used ISO trigraph feature. [...]
Trigraphs are covered in the draft C99 standard section 5.2.1.1
Trigraph sequences which says:
Before any other processing takes place, each occurrence of one of the following sequences of three characters (called trigraph sequences12)) is replaced with the corresponding single character.
and the following sequences include:
??= #