Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: [hwloc-devel] topology-x86.c warning
From: Jeffrey Squyres (jsquyres_at_[hidden])
Date: 2012-03-15 21:04:04

I found this warning in OMPI 1.5:

  CC topology-x86.lo
topology-x86.c: In function 'look_proc':
topology-x86.c:189: warning: 'ways' may be used uninitialized in this function

On the hwloc trunk, the ways variable is not initialized, and there's an "if" block where one of the branches initializes it and the other does not. Then below this conditional assignment, it has a comment:

      cache->size = linesize * linepart * ways * sets; /* FIXME: what if ways == -1 ? */

Which is somewhat amusing because ways was never set to -1. :-)

Should it be initialized to -1, or set to -1 in the "if" block right above it? And what to do if it is -1 in the cache->size assignment?

Jeff Squyres
For corporate legal information go to: