Sign in to follow this  
Boost113

Compiler warning about missing ending '

Recommended Posts

This check in some of the add-ons:

#ifdef AS_CAN_USE_CPP11
#include <chrono>
#else
#error Sorry, this requires C++11 which your compiler doesn't appear to support
#endif

Causes warnings about there being a missing ' character:

/home/hhyyrylainen/Projects/leviathan/libraries/include/add_on/datetime/datetime.h:12:60: varoitus: päättävä merkki ' puuttuu
 #error Sorry, this requires C++11 which your compiler doesn't appear to support
                                                            ^

This is nothing major, but it does cause annoying warnings when rebuilding files that include the add-on headers.

Share this post


Link to post
Share on other sites
You can just put the entire string in double quotes, and it should be fine. \' should also work. Or '''.

The issue is that technically ' is not a valid preprocessor token unless it is part of a character constant or part of a string literal. Some compilers ignore this restriction, so the code you provided may or may not cause an error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this