Warning messages when compiling with g++

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Warning messages when compiling with g++

yeshao
Dear Libconfuse developers,

When I try to compile cfgtest.c (http://www.nongnu.org/confuse/manual/cfgtest_8c-example.html) as a cpp file with g++, I get some
warning messages, for both libconfuse-dev v6.2 and v2.5 on debian.
I am not sure if we are supposed to simply ignore these warning messages or libconfuse needs to be changed to be fully C++ compatible.

Thank you for providing the community with such a wonderful tool!

Best,
Shawn

---------------------------------------------------------------------------------------------

Command used:

g++ -o test cfgtest.cpp -Wall -lconfuse

Warning messages received:

cfgtest.cpp: In function ‘int main(int, char**)’:
cfgtest.cpp:97: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:97: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:97: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:97: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:97: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:107: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
cfgtest.cpp:119: warning: deprecated conversion from string constant to ‘char*’
_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel

signature.asc (278 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Warning messages when compiling with g++

Martin Hedenfalk-4
Hi Shawn,

libConfuse is not a C++ library. Please compile with a C compiler.

        -martin


28 jun 2009 kl. 03.06 skrev [hidden email]:

> Dear Libconfuse developers,
>
> When I try to compile cfgtest.c (http://www.nongnu.org/confuse/manual/cfgtest_8c-example.html 
> ) as a cpp file with g++, I get some
> warning messages, for both libconfuse-dev v6.2 and v2.5 on debian.
> I am not sure if we are supposed to simply ignore these warning  
> messages or libconfuse needs to be changed to be fully C++ compatible.
>
> Thank you for providing the community with such a wonderful tool!
>
> Best,
> Shawn
>
> ---------------------------------------------------------------------------------------------
>
> Command used:
>
> g++ -o test cfgtest.cpp -Wall -lconfuse
>
> Warning messages received:
>
> cfgtest.cpp: In function ‘int main(int, char**)’:
> cfgtest.cpp:97: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:97: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:97: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:97: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:97: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:107: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’
> cfgtest.cpp:119: warning: deprecated conversion from string constant  
> to ‘char*’_______________________________________________
> Confuse-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/confuse-devel



_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Warning messages when compiling with g++

yeshao
Hi Martin,

In confuse.h, I can see some effort to make it C++ compatible, the
__cplusplus macro switch, which makes me wonder if there is such an
intent.

-Shawn

On Mon, Jun 29, 2009 at 7:44 AM, Martin Hedenfalk<[hidden email]> wrote:

> Hi Shawn,
>
> libConfuse is not a C++ library. Please compile with a C compiler.
>
>        -martin
>
>
> 28 jun 2009 kl. 03.06 skrev [hidden email]:
>
>> Dear Libconfuse developers,
>>
>> When I try to compile cfgtest.c
>> (http://www.nongnu.org/confuse/manual/cfgtest_8c-example.html) as a cpp file
>> with g++, I get some
>> warning messages, for both libconfuse-dev v6.2 and v2.5 on debian.
>> I am not sure if we are supposed to simply ignore these warning messages
>> or libconfuse needs to be changed to be fully C++ compatible.
>>
>> Thank you for providing the community with such a wonderful tool!
>>
>> Best,
>> Shawn
>>
>>
>> ---------------------------------------------------------------------------------------------
>>
>> Command used:
>>
>> g++ -o test cfgtest.cpp -Wall -lconfuse
>>
>> Warning messages received:
>>
>> cfgtest.cpp: In function ‘int main(int, char**)’:
>> cfgtest.cpp:97: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:97: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:97: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:97: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:97: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:107: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’
>> cfgtest.cpp:119: warning: deprecated conversion from string constant to
>> ‘char*’_______________________________________________
>> Confuse-devel mailing list
>> [hidden email]
>> http://lists.nongnu.org/mailman/listinfo/confuse-devel
>
>


_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Warning messages when compiling with g++

ohnobinki
On Mon, Jun 29, 2009 at 09:37:25AM -0700, Shaozhi Ye wrote:
> Hi Martin,
>
> In confuse.h, I can see some effort to make it C++ compatible, the
> __cplusplus macro switch, which makes me wonder if there is such an
> intent.
Having this macro only makes it easier on C++ developers who want to use a C library.

--
ohnobinki

Look out for missing apostrophes! (or extraneous ones)


_______________________________________________
Confuse-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/confuse-devel