Question about strtof() function under FreeBSD 4.9

David Schultz das at FreeBSD.ORG
Sun Mar 28 15:18:22 PST 2004


On Sat, Mar 27, 2004, Eric De la Cruz Lugo wrote:
> I just need to know if the strtof function in <stdlib> will be implemented 
> soon in the 4.9 Release, I checked the status and the 5.x Branch has it 
> already, will be long before 4.9 has it too? 
>  
> thanks in advance for your help, please reply to my address
> because am not in the list.
>  
> Am trying to compile a POS software (Linux, BananaPos) and in
> one code I need
> that function strtof(). 
>  
> showl I upgrade to 5.2.1? 

Getting strtof() and strtold() involved importing a big chunk of
software that isn't going to be backported to 4.X.  You can either
upgrade to 5.X, or use the following substitute, which should work
well except for overflow handling:

	float
	strtof(const char * restrict nptr, char ** restrict endptr)
	{
	
		return ((float)strtod(nptr, endptr));
	}


More information about the freebsd-standards mailing list