Opened 11 years ago

Closed 11 years ago

Last modified 11 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:
Has a Patch: no 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 Changed 11 years ago by axeld

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 Changed 11 years ago by axeld

Resolution: fixed
Status: assignedclosed

Fixed in hrev23896.

comment:3 Changed 11 years ago by andreasf

Works for me, thanks.

Note: See TracTickets for help on using tickets.