Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigraph sequences #303

Closed
Konstantin8105 opened this issue Nov 2, 2017 · 0 comments
Closed

Trigraph sequences #303

Konstantin8105 opened this issue Nov 2, 2017 · 0 comments

Comments

@Konstantin8105
Copy link
Contributor

Konstantin8105 commented Nov 2, 2017

Example of C code:

#include <stdio.h>
int main(){
        printf("Eh???/n");
        return 0;
}

See par.5.2.1.1 "Trigraph sequences" http://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf
Result of GCC without flag -trigraphs if run gcc -o tri tri.c; ./tri:

tri.c: In function ‘main’:
tri.c:3:13: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
  printf("Eh???/n");
             ^
Eh???/n

Result of GCC with flag -trigraphs if run gcc -o tri -trigraphs tri.c; ./tri:

Eh?

Result of CLANG without flag -trigraphs if run clang -E tri.c:

# 2 "tri.c" 2
int main(){
 printf("Eh???/n");
 return 0;
}

Result of CLANG with flag -trigraphs if run clang -E -trigraphs tri.c:

# 2 "tri.c" 2
int main(){
 printf("Eh?\n");
 return 0;
}

Result of c2go after transpilation:

func main() {
        __init()
        noarch.Printf([]byte("Eh???/n\x00"))
        return
}

Now, Trigraphs are not support in transpiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant