You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C99 Standard 6.10.3.3 (the ## operator) says that the name of an empty argument should be replaced with a placeholder, before performing the operator. Concatenating a placeholder with another token (possibly another placeholder) results in the other token. Placeholders are discarded after all ## operators have been performed.
The code in preprocessor.py simply removes the empty argument's name from the replacement text, causing the next or previous token to be used instead of a placeholder.
Examples:
#definegreet(x, y) Hello x ## y
greet(Abe, Lincoln) ->Hello, AbeLincolngreet(Abe, ) ->Error: ## at the end of the replacement text, not Hello Abe
greet(, Lincoln) ->HelloLincoln, notHelloLincoln
The fix is to simply follow the Standard strictly, and make a temporary token whose value is an empty string and which has a different type which would allow it to be later removed from the results.
The text was updated successfully, but these errors were encountered:
C99 Standard 6.10.3.3 (the ## operator) says that the name of an empty argument should be replaced with a placeholder, before performing the operator. Concatenating a placeholder with another token (possibly another placeholder) results in the other token. Placeholders are discarded after all ## operators have been performed.
The code in
preprocessor.py
simply removes the empty argument's name from the replacement text, causing the next or previous token to be used instead of a placeholder.Examples:
The fix is to simply follow the Standard strictly, and make a temporary token whose value is an empty string and which has a different type which would allow it to be later removed from the results.
The text was updated successfully, but these errors were encountered: