This is fixed in the dev repository. The fix was to cast the value being
switched on to an int. The compiler then no longer expects all the case
values to be members of the same enum.

Gabe

Richard Strong wrote:
> Hi all,
>
> I checked out the unstable M5 last Thursday and saw a gcc-4.5.2
> warning that is being treated as an error:
>
> scons: Building targets ...
>  [     CXX] ALPHA_SE/cpu/inorder/resource_pool.cc -> .do
> cc1plus: warnings being treated as errors
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:
> In member function 'void
> ResourcePool::scheduleEvent(InOrderCPU::CPUEventType,
> ResourcePool::DynInstPtr, int, int, ThreadID)':
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:318:7:
> error: case value '10' not in enumerated type 'InOrderCPU::CPUEventType'
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:347:7:
> error: case value '11' not in enumerated type 'InOrderCPU::CPUEventType'
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:
> In member function 'virtual void ResourcePool::ResPoolEvent::process()':
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:513:7:
> error: case value '10' not in enumerated type 'InOrderCPU::CPUEventType'
> /home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.cc:521:7:
> error: case value '11' not in enumerated type 'InOrderCPU::CPUEventType'
> scons: ***
> [/home/rstrong/build/m5-idle/build/ALPHA_SE/cpu/inorder/resource_pool.do]
> Error 1
>
> Adding place holders in src/cpu/inorder/cpu.hh::CPUEventType after
> NumCPUEvents removes the error. I think this is caused by
> src/cpu/inorder/resource_pool.cc::scheduleEvent paramter e_type which
> is of type InOrderCPU::CPUEventType.  This type is used for the case
> statements on lines 318 and 347  which uses a type of
> ResPoolEventType. It would seem that the newer compiler is able to do
> analysis on the range of possible enumeration values.
>
> Best,
> -Rick
> ------------------------------------------------------------------------
>
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev
>   

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to