Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1757 closed enhancement (fixed)

Symbol 'gcvt' not found

Reported by: andreasf Owned by: axeld
Priority: normal Milestone: R1
Component: System/libroot.so Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description

The gcvt function is obsolete but apparently available and in use on R5.

Copying Perl 5.8.8 compiled on R5 over to Haiku complains about the symbol:

elf_resolve_symbol: could not resolve symbol 'gcvt'
resolve symbol: "gcvt" returned: -2147478780
runtime_loader: troubles relocating: 0x80001304 (image: libperl.so)

Should we add the gcvt function to libroot without adding it to Haiku's headers? That way it would not be picked up by Haiku apps but would provide compatibility with R5; an implementation like this might work:

char* gcvt(double value, int length, char* buf) {
  sprintf(buf, "%.*g", length, value);
  return buf;
}

http://www.thinkage.ca/english/gcos/expl/c/lib/gcvt.html

Change History (3)

comment:1 by axeld, 17 years ago

Status: newassigned

Even though gcvt() (together with ecvt(), and fcvt()) is marked legacy, it's still part of the current POSIX standard, so we should add it to our headers as well.

comment:2 by axeld, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev23896.

comment:3 by andreasf, 17 years ago

Works for me, thanks.

Note: See TracTickets for help on using tickets.