ducdh1210 / labstreaminglayer

Automatically exported from code.google.com/p/labstreaminglayer
0 stars 0 forks source link

Upon inclusion of lsl_cpp.h: "ISO C++11 does not allow conversion from string literal to 'char *'" #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a C++ project, including lsl_cpp.h
2. Try to compile.
3. Get error or warning generated from lsl_cpp.h line 272.

What version of the product are you using? On what operating system?
1.10 on OSX.
My g++ --version:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix


Please provide any additional information below.
When I use g++ from the command line the message (in the topic) is only a 
warning and I may compile. However, I am trying to build an Unreal Engine 4 
plugin and this results in an error that stops compiling. I may be able to 
change the UnrealBuildTool compiler settings but I think it's a better solution 
to fix this warning/error within lsl.

Line 272, the source of the problem, calls lsl_create_streaminfo with the 
first, second, and sixth (last) positional arguments as string literals 
("untitled", "", ""). The method declaration on lsl_c.h line 300 defines these 
arguments as char * (char *name, char *type, char *source_id). This is 
considered bad practice because string literals are immutable but char * are 
not.

If the intention is indeed that these are to be immutable then lsl_c.h line 300 
can have those arguments changed to const char *. Otherwise, it may be wise to 
change the way the function is called in lsl_cpp.h.

Original issue reported on code.google.com by chadwick...@gmail.com on 3 Dec 2014 at 4:42

GoogleCodeExporter commented 9 years ago
Fixed. Will be in next release.

Original comment by christia...@gmail.com on 13 Jan 2015 at 12:51