Hi,
GCC 4.0.0 and up use gcc_assert and gcc_unreachable for assertions and unreachable code. This patch updates gpc's assert to be gcc_assert and gcc_unreachable and have the same sematics as the upstream assertion functions.
This along with the other patch was built and tested against gcc 3.3 cvs on ia64-linux.
Hi,
GCC 4.0.0 and up use gcc_assert and gcc_unreachable for assertions and unreachable code. This patch updates gpc's assert to be gcc_assert and gcc_unreachable and have the same sematics as the upstream assertion functions.
This along with the other patch was built and tested against gcc 3.3 cvs on ia64-linux.
James A. Morrison wrote:
GCC 4.0.0 and up use gcc_assert and gcc_unreachable for assertions and unreachable code. This patch updates gpc's assert to be gcc_assert and gcc_unreachable and have the same sematics as the upstream assertion functions.
We required an assert which evaluates its argument for side-effects, but indeed those cases were few, so I don't mind changing it. Applying your patch.
(Note to other readers, this does *not* affect the Pascal-side `Assert'. It still always evaluates its argument.)
I've checked that gcc_assert does almost the same as our assert. The main difference is that it doesn't print the text of the failed command. Of course, it can be looked up via file name and line number, but if the versions don't match exactly, line numbers may vary easily. But I suppose we can live with that ...
Frank