style: remove err.h to prevent a name collision
Review Request #3650 - Created Oct. 10, 2016 and submitted
Information | |
---|---|
Brandon Potter | |
gem5 | |
default | |
Reviewers | |
Default | |
Changeset 11672:b10ab7d47bf5 --------------------------- style: remove err.h to prevent a name collision Andreas Sandberg's patch, reviews.gem5.org/r/3648/, exposes a problem. Our src/base/misc.hh includes a macro "warn" that redefines the warn declaration in <err.h> if src/base/misc.hh is included first before <err.h>. The function declaration in <err.h> gets clobbered by our macro so that the function is redefined into a form that doesn't work for the header file declaration. We should really rename our version of "warn" to something else (and likely the other macros that we have with names like panic and fatal). This reordering may cause further issues for poorly named macros so we should discuss this more generally.
The inclusion of err.h (which is a non-standard BSD extension) seems incorrect. I would argue that this particular name collision is benign since this isn't a standard API.
Ship It!
Ship It!