bfd_abort vs. noreturn vs. _exit

Jay K jay.krell@cornell.edu
Sat May 8 05:11:00 GMT 2010


/bin/sh ./libtool --tag=CC   --mode=compile alpha-dec-vms-gcc -DHAVE_CONFIG_H -I. -I/src/binutils/src/bfd -DOSF_CORE   -I. -I/src/binutils/src/bfd -I/src/binutils/src/bfd/../include   -DBINDIR='"/usr/local/bin"'  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -MT bfd.lo -MD -MP -MF .deps/bfd.Tpo -c -o bfd.lo /src/binutils/src/bfd/bfd.c
libtool: compile:  alpha-dec-vms-gcc -DHAVE_CONFIG_H -I. -I/src/binutils/src/bfd -DOSF_CORE -I. -I/src/binutils/src/bfd -I/src/binutils/src/bfd/../include -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -MT bfd.lo -MD -MP -MF .deps/bfd.Tpo -c /src/binutils/src/bfd/bfd.c -o bfd.obj
cc1: warnings being treated as errors
/src/binutils/src/bfd/bfd.c: In function '_bfd_abort':
/src/binutils/src/bfd/bfd.c:944:1: error: 'noreturn' function does return
make[2]: *** [bfd.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


libbfd-in.h:
extern void _bfd_abort
  (const char *, int, const char *) ATTRIBUTE_NORETURN;


bfd.c:
void
_bfd_abort (const char *file, int line, const char *fn)
{
  if (fn != NULL)
    (*_bfd_error_handler)
      (_("BFD %s internal error, aborting at %s line %d in %s\n"),
       BFD_VERSION_STRING, file, line, fn);
  else
    (*_bfd_error_handler)
      (_("BFD %s internal error, aborting at %s line %d\n"),
       BFD_VERSION_STRING, file, line);
  (*_bfd_error_handler) (_("Please report this bug.\n"));
  _exit (EXIT_FAILURE);
}


I removed -Werror.


/usr/local/alpha-dec-vms/include/unistd.h doesn't declare _exit with such an annotation.
Possibly the native compiler has no such mechanism.


build=darwin
target=host=alpha-dec-vms
gcc=4.5.0


It seems to me there is a slight tension between portability and quality.
Quality says to put in the attribute for slightly better compiler analysis/diagnostics.
Portability says to remove it.


 - Jay
 		 	   		  



More information about the Binutils mailing list