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

Invalid literal suffix #323

Closed
flm8620 opened this issue Jul 5, 2017 · 3 comments
Closed

Invalid literal suffix #323

flm8620 opened this issue Jul 5, 2017 · 3 comments
Milestone

Comments

@flm8620
Copy link
Contributor

flm8620 commented Jul 5, 2017

Here

The single quote mark is LEFT SINGLE QUOTATION MARK U+2018, which causes error in my compiler(VS2015).
It's better to use APOSTROPHE U+0027

Error:

73>sofa\sofa\v16.12\src\applications\projects\runSofa\Main.cpp(316): error C3688: invalid literal suffix '鈥for'; literal operator or literal operator template 'operator ""鈥for' not found
73>sofa\sofa\v16.12\src\applications\projects\runSofa\Main.cpp(316): error C2146: syntax error: missing ';' before identifier '鈥'
73>sofa\sofa\v16.12\src\applications\projects\runSofa\Main.cpp(316): error C2065: '鈥': undeclared identifier
73>sofa\sofa\v16.12\src\applications\projects\runSofa\Main.cpp(316): error C2065: 'formatting鈥': undeclared identifier
@damienmarchal
Copy link
Contributor

Hello @flm8620

It is very interesting, I didn't even knew that stuff in a pair of " " could cause compilation problem.
I'm also surprised that our Continuous integration system is compiling sofa with VS2015 but didn't reported a problem. Maybe something related with the language you use on your system ?

Anyway, thank you very much for your report. If you have time maybe you can submit a pull-request to fix that otherwise I will do it.

Regards,

@maxime-tournier
Copy link
Contributor

The string should be properly prefixed as per the standard: http://en.cppreference.com/w/cpp/language/string_literal

@flm8620
Copy link
Contributor Author

flm8620 commented Jul 7, 2017

I know the reason. My OS is windows 8, language is French. But I have some softwares are set to Chinese.
The UFT-8 code of LEFT SINGLE QUOTATION MARK is 0xE2 0x80 0x98.
The weird character 鈥 has code 0xE2 0x80 in GBK.
I have idea why Visual Studio use GBK instead of UTF-8.

@flm8620 flm8620 closed this as completed Jul 14, 2017
@guparan guparan added this to the v17.12 milestone Sep 13, 2017
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

4 participants