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

Problem using check 0.11.0 on OS X #110

Closed
njh opened this issue Jan 10, 2017 · 7 comments
Closed

Problem using check 0.11.0 on OS X #110

njh opened this issue Jan 10, 2017 · 7 comments

Comments

@njh
Copy link
Contributor

njh commented Jan 10, 2017

Hello,

I have just tried using check 0.11.0 on OS 10.12.1:

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0

The error message from clang is:

/usr/local/Cellar/check/0.11.0/include/check.h:686:37: error: invalid suffix on literal; C++11 requires a space
      between literal and identifier [-Wreserved-user-defined-literal]
  "Assertion '%s' failed: %s == %.*"TM"g, %s == %.*"TM"g", \
                                    ^
                                     
/usr/local/Cellar/check/0.11.0/include/check.h:686:53: error: invalid suffix on literal; C++11 requires a space
      between literal and identifier [-Wreserved-user-defined-literal]
  "Assertion '%s' failed: %s == %.*"TM"g, %s == %.*"TM"g", \
                                                    ^
                                                     
/usr/local/Cellar/check/0.11.0/include/check.h:698:39: error: invalid suffix on literal; C++11 requires a space
      between literal and identifier [-Wreserved-user-defined-literal]
    "Assertion '%s' failed: %s == %.*"TM"g", \
                                      ^

I fixed it very easily by putting a space on either side of TM but I am confused as to why nobody else has seen this and why it hasn't been picked up my Travis. Perhaps because I am using a newer version of clang?

I am happy to send a Pull Request, if you think it is the right thing to do.

nick.

@brarcher
Copy link
Contributor

Are you using clang++ when compiling or clang? Travis-CI is setup to use clang, but I wonder if clang++ is being more picky.

It may be that Travis-CI is not using the latest version of Clang, and maybe that is the reason you are hitting this. There is a test run on Jenkins to check that clang++ also works, and that test also did not fail. Again, that may not be the newest version of Clang.

Feel free to submit a pull request to resolve it.

@njh
Copy link
Contributor Author

njh commented Jan 15, 2017

Thanks Branden. Yes, I was compiling using clang's c++ using -std=c++11 - it is Arduino code:

https://github.com/njh/EtherSia

I wonder if there should be any C++ compiler test in the check test-suite?
But I guess there are a lot of different permutations (different compilers, different coding standards, different OSs...)

I have double checked and then created a Pull Request in #111.

@brarcher
Copy link
Contributor

I wonder if there should be any C++ compiler test in the check test-suite?

I am not opposed to adding additional tests, or in this situation checking Check with different compilers and environments. Right now Check is compiled on Linux (gcc, clang++ [older version], gcc cross compiled for mingw), OSX (clang), and Windows (Cygwin, MinGW, MinGW-64, MSVC, VS). Hopefully when the Jenkins environment is updated someday by CloudBees the Clang version will be increased and catch this. Trying clang++ and g++ on Travis-CI may help.

@brarcher
Copy link
Contributor

I attempted to run g++ and clang++ on Travis-CI, and in both cases Check built successfully. Perhaps the version in use there is also out-of-date from what you are using.

@njh
Copy link
Contributor Author

njh commented Jan 16, 2017

I am slightly unclear about how Apple clang version numbers compare to off-the-self llvm-clang. It seems to loose the relationship at Apple LLVM version 7.0.0:
https://gist.github.com/yamaya/2924292

The latest version of LLVM is 3.9.1:
http://releases.llvm.org/download.html

Debian stretch (testing) has Clang version 3.8:
https://packages.debian.org/search?keywords=clang

@brarcher
Copy link
Contributor

I've merged in the fix you provided, so I'll close this issue. Thanks for the fix!

I'm as confused as you are on the Clang versions.

@njh
Copy link
Contributor Author

njh commented Jan 28, 2017

Ok, thanks. Hopefully it won't cause any more problems.

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

2 participants