Bug, sqrtf not implemented

Nathan Sidwell nathan@acm.org
Mon Mar 15 04:42:00 GMT 1999


Hi,
g++ silently introduces a prototype for `sqrtf' (amongst others). Thus the
following program compiles without error. Unfortunately, on this sparc-solaris
box, it fails to link, moaning about undefined reference to `sqrtf'. I'd
expected an error during compilation, just as if `sqrtf' had been a random
function like `foo'.

int main()
{
  sqrtf(1.0f);
  return 0;
}

nathan@manao:125>ss-g++  foo.cc -ansi -pedantic -W -Wall 
/var/tmp/ccHVcaaa.o: In function `main':
/var/tmp/ccHVcaaa.o(.text+0x10): undefined reference to `sqrtf'
collect2: ld returned 1 exit status
nathan@manao:126>ss-g++ -v
Reading specs from
/local/nathan/ss/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.93.11/specs
gcc version egcs-2.93.11 19990307 (gcc2 ss-980929 experimental)
nathan@manao:127>uname -a
SunOS manao 5.6 Generic_105181-03 sun4u sparc

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


More information about the Gcc-bugs mailing list