I recently ran into a bug that would have been caught by the compiler
if we didn't have -Wno-sign-compare in our build.  I've made attempts
in the past to fix this, but always stopped short and never finished.

I can't guarantee that I'll do it all at once this time, but I'd at
least like to make some progress towards this, so I've removed the
flag and started fixing bugs.  In doing so, it points out some
potentially bad things we're doing with types.  The biggest example is
thread ids and number of threads variables.  We use unsigned, int,
short, and unsigned short for these and we should only be using one of
them.  Of course this doesn't ever turn out to be a problem since we
never use very many threads, but I'm sure there are other examples
that could be worse in the code.

Another example of something i've wanted to do for quite a while is
create a src/base/types.hh class that contains typedefs for all of the
pervasive types that we care about.  Addr and Tick would get moved
here as well as a few new types from ruby.  I could use this file for
a new ThreadIndex type.

I'm mostly expecting nobody to care about any of this, but since doing
any of this will touch a whole lot of files, I thought I'd let people
know so they could comment.

I could be talked out of src/base/types.hh if anyone cares, but it
doesn't seem bad to have a file that contains typedefs for several
very common types.  In effect, it would largely replace sim/host.hh,
but it would also include inttypes.h or stdint.h as appropriate so
there is just one file to include.  (I've always hated the name
host.hh myself).

  Nate
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to