BUG: struct keyword required before struct type name in tal-notreent.c
Torbjorn Granlund
tege at swox.com
Wed Apr 5 19:22:30 CEST 2006
<librik at panix.com> writes:
A couple of function headers in GMP 4.2's tal-notreent.c define
struct-type parameters without using the keyword "struct" before
the type name. This is a C++ idiom that GCC allows, but it's not
really correct C and won't compile elsewhere.
Luckily, this is easy to fix: insert "struct" before the struct
name "tmp_marker", in __gmp_tmp_mark and gmp_tmp_free.
This is a worrying bug, since no compiler I know actually can compile
this file. A file with syntax errors is usually not extensively
tested. The same file is in GMP 4.1.4 and several earlier releases.
:-(
--- tal-notreent.c.struct 2006-04-01 14:05:56.776715200 -0600
+++ tal-notreent.c 2006-03-14 09:57:54.000000000 -0600
@@ -99,5 +99,5 @@
storage. */
void
-__gmp_tmp_mark (struct tmp_marker *mark)
+__gmp_tmp_mark (tmp_marker *mark)
{
mark->which_chunk = current;
@@ -107,5 +107,5 @@
/* Free everything allocated since <mark> was assigned by __gmp_tmp_mark */
void
-__gmp_tmp_free (struct tmp_marker *mark)
+__gmp_tmp_free (tmp_marker *mark)
{
while (mark->which_chunk != current)
Please use "diff old new" in the future...
--
Torbjörn
More information about the gmp-bugs
mailing list