Compiler error for CppUTest 3.3 under Linux: unrecognized command line option "-Wsign-conversion"

422 views
Skip to first unread message

ferdi....@gmail.com

unread,
May 14, 2013, 2:10:14 AM5/14/13
to cppu...@googlegroups.com
Hello

I get the following compiler error when compiling CppUTest (by typing "make" in the CppUTest home directory). I think you've previously had a similar issue reported under Cygwin:
$ make
compiling AllocationInCppFile.cpp
cc1plus: error: unrecognized command line option "-Wsign-conversion"
cc1plus: error: unrecognized command line option "-Wsign-conversion"

Some additional information that might be useful:
$ uname -a
Linux ASBLX36 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x

$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
86_64 GNU/Linux

I get a similar result when compiling a simple "hello world" type C++ program:
$ make compileTest   
g++ -Wall -g -Wsign-conversion    compileTest.cpp   -o compileTest
cc1plus: error: unrecognized command line option "-Wsign-conversion"
make: *** [compileTest] Error 1

And also for a C program:
$ make compileTest_c
gcc -Wall -g -Wsign-conversion    compileTest_c.c   -o compileTest_c
cc1: error: unrecognized command line option "-Wsign-conversion"
make: *** [compileTest_c] Error 1


Martin Ertsaas

unread,
May 14, 2013, 2:32:00 AM5/14/13
to cppu...@googlegroups.com
Is this by typing just make in the CppUTest root directory? No
configure/cmake stuff? Both of these will check that your compiler
actually supports these flags, and if it don't it won't be used.
The -Wsign-conversion is a standard gcc flag, which probably came a bit
after 4.1.

Being that you are using such an old compiler, I would suggest you run
./configure && make instead of just make. Or use cmake for the same thing.

- Martin
> --
> You received this message because you are subscribed to the Google
> Groups "cpputest" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cpputest+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

ferdi....@gmail.com

unread,
May 14, 2013, 4:07:43 AM5/14/13
to cppu...@googlegroups.com
Yes, I typed just "make". I'm using www.cpputest.org as primary documentation for CppUTest, but it doesn't have much to say about the build process, so I'm following the instructions in README_InstallCppUTest.txt in the CppUTest root directory, and this just says to type "make".

Is there documentation available for the more advanced procedure you describe (i.e. "configure")? Is configure an application that generates a Makefile? As far as I can tell, I don't have it installed.

Thanks

Martin Ertsaas

unread,
May 14, 2013, 4:14:26 AM5/14/13
to cppu...@googlegroups.com
Typing make is a bit of a simplification. This will only work if your compiler supports all the same flags as was on the gcc used when generating the makefile.

configure is an executable in the root directory of cpputest, which generates a makefile. The configure itself is created by autotools, so in worst case scenario you have to run autoreconf or something (not used
autotools that much, but Bas would know the correct command).

But try, from the root of cpputest:

./configure && make

hopefully this will work.

- Martin

Bas Vodde

unread,
May 14, 2013, 6:16:29 AM5/14/13
to cppu...@googlegroups.com

Hi Ferdi,

Could you try out CppUTest 3.4 (with the configure) or the latest.

You can find them at cpputest.github.io.

I've also changed the README to explain to use either "configure" or "cmake"

Thanks!

Bas

ferdi....@gmail.com

unread,
May 15, 2013, 5:16:28 AM5/15/13
to cppu...@googlegroups.com
Hi Bas

I've upgraded to v 3.4, and this problem is solved. However, I experienced some problems with 3.4, and I'll report them in another topic. Thanks for your help; I imagine getting CppUTest to build correctly on so many platforms is a never-ending task with little glory.

Bas Vodde

unread,
May 15, 2013, 6:01:47 AM5/15/13
to cppu...@googlegroups.com

Hi Ferdi,

Ok, curious to know about the other problem :)

But yeah, it is hard to keep it working on lots of compilers. The 3.4 version should do quite a lot better on that due to the use of autotools.

Thanks,

Bas
Reply all
Reply to author
Forward
0 new messages