Redhat 5 compilation errors in xmem_error.c

Nick Simicich njs at scifi.squawk.com
Fri Dec 6 03:45:43 CET 2002


At 05:05 PM 2002-12-05 +0100, Matthias Andree wrote:

>Nick Simicich <njs at scifi.squawk.com> writes:
>
> > #ifdef NEVER
> > /*@noreturn@*/
>
>Here should have been a function declaration for die. Can you diff
>against the original version and see if that got lost over your change?

Crap, I did not bother to save the original or the original tar file, and 
this system does not have bzcat.  Well, I can unpack it by sshing to a 
system that had it...

[root at scifi bogofilter]# ssh -e none parrot-int bzcat < 
bogofilter-0.9.1.tar.bz2  > bogofilter-0.9.1.tar
root at parrot-int's password:
[root at scifi bogofilter]# grep "ifdef NEVER" bogofilter-0.9.1/tests/*.c
bogofilter-0.9.1/tests/dumbhead.c:#ifdef NEVER
[root at scifi bogofilter]# mv bogofilter-0.9.1/tests/dumbhead.c 
bogofilter-0.9.1/tests/dumbhead.c.mod
[root at scifi bogofilter]# tar -vxf bogofilter-0.9.1.tar 
bogofilter-0.9.1/tests/dumbhead.c
bogofilter-0.9.1/tests/dumbhead.c
[root at scifi bogofilter]# diff -u bogofilter-0.9.1/tests/dumbhead.c.mod 
bogofilter-0.9.1/tests/dumbhead.c
--- bogofilter-0.9.1/tests/dumbhead.c.mod       Thu Dec  5 11:57:32 2002
+++ bogofilter-0.9.1/tests/dumbhead.c   Sun Nov 10 19:59:35 2002
@@ -17,11 +17,10 @@

  #include <stdio.h>
  #include <stdlib.h>
-#ifdef NEVER
+
  /*@noreturn@*/
  #ifdef __GNUC__
  __attribute__ ((noreturn))
-#endif
  #endif
  static void die(const char *tag) {
      perror(tag);
[root at scifi bogofilter]#grep "ifdef NEVER" bogofilter-0.9.1/*.c
bogofilter-0.9.1/xmem_error.c:#ifdef NEVER
[root at scifi bogofilter]# mv bogofilter-0.9.1/xmem_error.c 
bogofilter-0.9.1/xmem_error.c.mod
[root at scifi bogofilter]# tar -vxf bogofilter-0.9.1.tar 
bogofilter-0.9.1/xmem_error.c
bogofilter-0.9.1/xmem_error.c
[root at scifi bogofilter]# diff -u bogofilter-0.9.1/xmem_error.c.mod 
bogofilter-0.9.1/xmem_error.c
--- bogofilter-0.9.1/xmem_error.c.mod   Thu Dec  5 11:57:30 2002
+++ bogofilter-0.9.1/xmem_error.c       Sun Nov 24 13:16:08 2002
@@ -2,11 +2,10 @@

  #include <stdio.h>
  #include "xmalloc.h"
-#ifdef NEVER
+
  /*@noreturn@*/
  #ifdef __GNUC__
  __attribute__ ((noreturn))
-#endif
  #endif
  void xmem_error(const char *a)
  {
[root at scifi bogofilter]#

No, those are all the changes I made...


> > #ifdef __GNUC__
> > __attribute__ ((noreturn))
> > #endif
> > #endif
> >
> > stuff is not recognized.  (The #ifdef NEVER stuff is added by me, since
> > it seemed that my version of __GNUC__ has no idea what you are talking
> > about.)  I have no idea how much optimization an __attribute__
> > ((noreturn)) actually gives you given that this can't be communicated, I
> > don't think.  If this is an important optimization, it might be better
> > inlined.
>
>It's utterly irrelevant and just there to kill gcc 3.2 warnings that
>we're not interested in. Just kill the __attribute__ line if your gcc
>2.7.2.3 barfs on it.
>
> > ./t.score1: syntax error near unexpected token `then'
> > FAIL: t.score1
>
>What shell does DeadRat 5 have for /bin/sh?

[root at scifi bogofilter-0.9.1]# rpm -q bash
bash-1.14.7-6
[root at scifi bogofilter-0.9.1]#

>Try /bin/sh -x ./t.score1 and show me the output, I might be able to do
>something about it.

[root at scifi tests]# /bin/sh -x ./t.score1
+ . ./t.frame
++ set -e
++ [ -z  ]
+++ echo ./t.score1
+++ sed s at ./t.@@
++ NAME=score1
+++ date +%m%d
++ DATE=1205
++ TMPDIR=score1.1205
++ rm -rf score1.1205
++ mkdir score1.1205
++ BOGOFILTER_DIR=score1.1205
++ export BOGOFILTER_DIR
++ ../bogofilter -n
+ echo
+ ../bogofilter -p -e
[root at scifi tests]#  ./t.score1
[root at scifi tests]#

As I noted, the ./t.score1, etc ran fine.  It is likely something in the 
stuff in the makefile, but I don't see what could be causing it there 
either.  I am using the bash that came with the system, always have.

> > [root at scifi bogofilter-0.9.1]# gcc -v
> > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
> > gcc version 2.7.2.3
> > [root at scifi bogofilter-0.9.1]#
> >
> > I think what is needed is an ifdef other than simply __GCC__
>
>Apparently, all developers have gcc 2.95 or newer going, so this
>__attribute__ issue was missed.
>
>Would you care to send me a gzipped tarball of your gcc 2.7.2.3
>gcc.info* files in private mail? Thanks.

On its way -- 399 kb. I don't understand why I didn't just post it here. :-)

--
If you doubt that magnet therapy works, I put to you this observation: When 
refrigerators were first invented, in the 1940s, they were rather 
unreliable, but then they became significantly more reliable. The basic 
design of the refrigerator did not change, and we all know that quality was 
important back then, so I doubt that newer refrigerators are made better. 
Refrigerators have become more reliable because of the rise of the 
refrigerator magnet.
Nick Simicich - njs at scifi.squawk.com



More information about the Bogofilter mailing list