Hi Alec, I'm not sure if this really answers your question, but there are a number of places in the code where for different compiler options some variables are unused. This often happens when doing debug checks (e.g., asserts) which are removed when compiling fast mode. To ignore these warnings from the compiler, there is the macro "M5_VAR_USED" which can be used after declaring the variable to make sure that it appears used to the compiler (like __attribute__((unused))).
Jason On Thu, Jul 13, 2017 at 3:34 PM Alec Roelke <[email protected]> wrote: > Hi Everyone, > > Lately when I've been trying to build gem5.opt for RISC-V, I've been > getting an error that three of the scalar constants defined in registers.hh > are 'defined but not used' (one of which definitely is used in faults.cc). > I've been under the impression that g++ is supposed to ignore this warning > for values defined as const, but I've had to mark them with __attribute__ > ((unused)) to get it to compile. > > The only solutions I can find (define them as extern and initialize them > in a .cc file) when I search for it only apply to arrays, but all the const > arrays in registers.hh work fine. This error only appears for some of the > scalar constants. > > Is anyone else having this issue? > > Thanks, > Alec Roelke > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
