Fix some compile warnings and errors on an up-to-date system
This enables OpenROAD to build with a recent compiler; without hitting warnings that become errors due to -Werror (the first commit, the free on a class member, is a particularly concerning issue...)
Not sure if all of these will be of interest as-is but hopefully at least some of this is useful!
What compiler reports these problems?
GCC 11.1.0
I still believe -Werror should only be enabled for CI builds for this reason.
I still believe
-Werrorshould only be enabled for CI builds for this reason.
Yeah, that's how I have nextpnr set up too because of similar concerns.
Note that 4edea48 is fixing a genuine error for me, not a warning-turned-error, so would still be needed and some of the other free-related ones might be worth looking at as it seems like the compiler has found genuine concerns.
Note that there is ALLOW_WARNINGS cmake option if needed.
What version of spdlog are you using? I don't see any such assertion in the current version.
Note that 4edea48 is fixing a genuine error for me, not a warning-turned-error, so would still be needed and some of the other free-related ones might be worth looking at as it seems like the compiler has found genuine concerns.
Realistically it would be more helpful if these enums had a toString() function so that they can be printed.
I fixed the issue addressed in 4edea486af07f8ea7f9c0d6d00bf5eeb9d1c3761 in https://github.com/The-OpenROAD-Project/OpenROAD/pull/1542/files in a fashion I prefer (operator<< not int cast). Please revert that commit from this PR and re-merge master to this PR.
Sorry, this unfortunately ended up forgotten all too long as life got in the way in various forms - I've finally rebased it and addressed some comments although a new issue appeared with a recent fmt version - I've fixed it in afb3313 but I can see there are other approaches that could be taken there.
Seems like my fix in afb3313 was no good because it breaks older fmt versions... not sure what you think is the best approach to supporting everything here.
The fmt change has been discussed in various PRs. I think FMT_DEPRECATED_OSTREAM is the best solution until fmt fixes https://github.com/fmtlib/fmt/issues/3088