We should be talking about this on the mailing list, so I'll reply to
there. 3.4.6 is supposed to be fine, but it's not likely any of the
developers are using a gcc that old, and so issues on those versions can
creep in which won't be caught for a while, possibly ever. If possible
I'd recommend moving up to maybe something after 4.0 or 4.1. In this
particular instance, though, it looks like that -1 return value is never
checked for, and since it'll be turned into a very large unsigned number
something bad will probably happen if it's ever actually returned. I'll
file a bug to have it looked at, and in the mean time you can probably
change the cases that would return -1 into calls to the panic()
function. If you're not familiar with it, panic is pretty
straightforward to use, and you can find examples all over. It's
possible the author really did intend to return a very large value
instead of flagging an error, and if that's the case you'll see the
panic crop up.
Gabe
Navid Farazmand wrote:
> I have resolved the problem with gcc (using a local newer version) by
> setting CC and CXX variables.
>
> But the problem still exists which I think is not related to the
> version of gcc.
> Here is the part of code for which warning/error is generated:
>
> unsigned descSize()
> {
> switch(bsize()) {
> case 0: return bsex() == 0 ? 2048 : -1;
> case 1: return bsex() == 0 ? 1024 : 16384;
> case 2: return bsex() == 0 ? 512 : 8192;
> case 3: return bsex() == 0 ? 256 : 4096;
> default:
> return -1;
> }
> }
>
> It seems that the function tries to generate an error in case the
> input value is not recognized, by returning a negative value for an
> unsigned return type.
> The following is the build command and the warning message which is
> generated:
>
> ********************************************************************************************************************************************************************************
> g++ -o build/ALPHA_FS/dev/i8254xGBe.o -c -Wno-deprecated -pipe
> -fno-strict-aliasing -Wall -Wno-sign-compare -Wundef -g -O3 -Werror
> -DTRACING_ON=1 -Ibuild/gzstream -Ibuild/libelf -Iext
> -I/usr/local/include/python2.4 -I/usr/include/mysql -Ibuild/ALPHA_FS
> build/ALPHA_FS/dev/i8254xGBe.cc
>
> In file included from build/ALPHA_FS/dev/i8254xGBe.hh:46,
> from build/ALPHA_FS/dev/i8254xGBe.cc:47:
> build/ALPHA_FS/dev/i8254xGBe_defs.hh: In member function `unsigned int
> iGbReg::Regs::RCTL::descSize()':
> build/ALPHA_FS/dev/i8254xGBe_defs.hh:492: warning: converting of
> negative value `-0x00000000000000001' to `unsigned int'
> scons: *** [build/ALPHA_FS/dev/i8254xGBe.o] Error 1
> scons: building terminated because of errors.
> ********************************************************************************************************************************************************************************
>
> The two options in the build command, -Wall and -Werror, require that
> all warnings (except a few ones which have been excluded explicitly)
> are generated and also warnings are treated as errors.
>
> I'm curious that whether the above code causes a warning or not,
> depends on the version of the compiler (It seems normal with the
> above switches that compiler generates warning and treat it as error,
> regardless of the version). Besides, I'm using gcc 3.4.6 which is
> supposed to be fine.
>
> Any suggestion/help appreciated.
>
>
> Regards,
> Navid.
>
> On Wed, Nov 3, 2010 at 7:41 PM, Gabriel Michael Black
> <[email protected] <mailto:[email protected]>> wrote:
>
> The warning is something that should be fixed soon and crops up
> with pretty recent versions of scons. It's just telling you we've
> used a keyword that's been deprecated and we need to switch to the
> new one, but functionally everything should be fine. I agree that
> the compiler error is most likely a version issue. I don't know
> for sure how to override it, but looking at the scons files I
> think if you set CC to your gcc and CXX to your g++ that might do it.
>
> Gabe
>
>
> Quoting Navid Farazmand <[email protected]
> <mailto:[email protected]>>:
>
> Hi,
> I'm getting the following warning and error while trying to
> compile m5. The
> warning message is printed many times (say around 50 times)
> but I have copied the last one and the error message follows.
>
>
> *****************************************************************************************************************************
> scons: warning: The build_dir keyword has been deprecated; use the
> variant_dir keyword instead.
> File
>
> "/home/nfarazma/NUCAR_research/m5/source/m5/build/ALPHA_FS/SConscript",
> line 251, in ?
> scons: done reading SConscript files.
> scons: Building targets ...
> g++ -o build/ALPHA_FS/dev/i8254xGBe.fo -c -Wno-deprecated -pipe
> -fno-strict-aliasing -Wall -Wno-sign-compare -Wundef -O3
> -Werror -DNDEBUG
> -DTRACING_ON=0 -Ibuild/gzstream -Ibuild/libelf -Iext
> -I/usr/local/include/python2.4 -I/usr/include/mysql
> -Ibuild/ALPHA_FS
> build/ALPHA_FS/dev/i8254xGBe.cc
> In file included from build/ALPHA_FS/dev/i8254xGBe.hh:46,
> from build/ALPHA_FS/dev/i8254xGBe.cc:47:
> build/ALPHA_FS/dev/i8254xGBe_defs.hh: In member function
> `unsigned int
> iGbReg::Regs::RCTL::descSize()':
> build/ALPHA_FS/dev/i8254xGBe_defs.hh:492: warning: converting
> of negative
> value `-0x00000000000000001' to `unsigned int'
> scons: *** [build/ALPHA_FS/dev/i8254xGBe.fo] Error 1
> scons: building terminated because of errors.
>
> *****************************************************************************************************************************
>
> I'm trying to compile m5 on a cluster. The gcc version is
> 3.4.5 on the
> cluster; so I'm suspicious that the problem is with gcc version.
> I have installed a local copy of gcc but I don't know which
> file/environment
> variable should I change so that Scons uses the local gcc copy.
>
> Any help is appreciated.
>
> Thanks,
> Navid.
>
> Regards,
> Navid Farazmand.
> PhD candidate at ECE Department,
> Northeastern University.
> Cell Phone: 617-447-8929
> [email protected] <mailto:[email protected]>
> [email protected] <mailto:[email protected]>
>
>
>
>
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users