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

Fix: using udl::operator "" _ #865

Closed
wants to merge 1 commit into from
Closed

Fix: using udl::operator "" _ #865

wants to merge 1 commit into from

Conversation

x4t3a
Copy link

@x4t3a x4t3a commented Feb 18, 2021

The following error started appearing error: missing space between ‘""’ and suffix identifier -- using udl::operator ""_;.

Compiler: powerpc-fsl-linux-g++ (GCC) 4.9.2 (compiler for powerpc architecture)
C++ version: --std=c++11

Easy fix by adding spaces :)

The following error started appearing `error: missing space between ‘""’ and suffix identifier -- using udl::operator ""_;`.

Compiler -- `powerpc-fsl-linux-g++ (GCC) 4.9.2` (compiler for powerpc architecture)
C++ version: --std=c++11
@yhirose
Copy link
Owner

yhirose commented Feb 18, 2021

@x4t3a, thanks for the pull request. The real cause of this problem is the clangformat setting .clangformt in this project. I often format httplib.h with it, and the current .clangformat removes the space... Here is the current setting:

BasedOnStyle: LLVM
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
Cpp11BracedListStyle: true

I'll find a setting that can avoid the particular behavior of clangformat. Thanks.

@x4t3a
Copy link
Author

x4t3a commented Feb 18, 2021

@yhirose, I've tried running your clang-format config in this online formatter and it seems ok. There are several versions there to try on. What version do you use?
Screenshot 2021-02-18 at 22 59 11

@yhirose
Copy link
Owner

yhirose commented Feb 18, 2021

@x4t3a, mine is installed via home brew on macOS. Here is the version.

> clang-format --version
clang-format version 10.0.1 

Also the line 2271 has the same issue.

@yhirose
Copy link
Owner

yhirose commented Feb 18, 2021

I confirmed the happens on the online checker as well.

image

@yhirose
Copy link
Owner

yhirose commented Feb 24, 2021

@x4t3a, when you have time, could you try this solution for old gcc compilers? If this workaround works on your environment, I'll put it in httplib.h. Thanks for your help!

@x4t3a
Copy link
Author

x4t3a commented Feb 24, 2021

@yhirose, alright, I'll try it. Thank you! :)

@yhirose
Copy link
Owner

yhirose commented Apr 1, 2021

I'll close it for now.

@liangyepianzhou
Copy link

liangyepianzhou commented Sep 5, 2024

@yhirose Thanks for your answer. I also encountered this problem. I am a C++ newbie. Do you mind telling me what is the minimum g++ standard to solve this problem?

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

Successfully merging this pull request may close these issues.

3 participants