audk/StdLib/LibC
Daryl McDaniel b04aba1773 StdLib: The formatting for double float values, within the gdtoa library, is improper.
When running Enquire.efi, several errors similar to the following are produced:
Maximum exponent = 128
Maximum number = 3.40282347e+38

*** WARNING: Possibly bad output from printf above
    expected value around 3.40282347e38, bit pattern:
    11111111 11111111 01111111 01111111
    sscanf gave           -inf, bit pattern:
    00000000 00000000 10000000 11111111
    difference= inf

Overflow doesn’t seem to generate a trap

The memory allocation tests will also fail, sometimes leaving all available memory consumed.

The correct output in the above example is:
Maximum exponent = 128
Maximum number = 3.40282347e+38
Overflow doesn't seem to generate a trap

The root cause is that all operations on values of Long or ULong type, within the gdtoa library, must be 32-bit operations.  A previous change replaced the Long and ULong definitions with INTN and UINTN, respectively.  While this is correct for a lot of Linux and NetBSD code, it was not correct for this library.

This fix reverts the definitions of ULong and Long back to 32-bit types.
A descriptive comment has also been added to the U union.
Additional white-space has been added to tidy up the definitions of the word0 and word1 macros.

Verified with Enquire.efi and the ISO/IEC C Library compliance Validation Suite.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15765 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-06 18:29:02 +00:00
..
CRT Add device abstraction code for the UEFI Console and UEFI Shell-based file systems. 2011-06-28 02:34:10 +00:00
Containers StdLib: Fix IA32 and X64 build issues. 2013-09-10 21:53:28 +00:00
Ctype StdLib: Add isDirSep character classification macro and function. Implement several Posix functions and clean up EfiSysCall.h. Align file mode handling with UEFI file protocol flags. 2011-11-30 00:52:45 +00:00
Locale StdLib/LibC/Locale/multibyte_Utf8.c: Fix obscure corner cases in wide to multibyte and multibyte to wide character conversions. The majority of problems center around the interpretation of the Length or Limit parameter when the Destination parameter is NULL. 2013-05-15 01:59:11 +00:00
Main StdLib: Simple code cleanup 2014-07-17 20:54:49 +00:00
Math
NetUtil Add Socket Libraries. 2011-07-30 00:30:44 +00:00
Signal
StdLib StdLib/LibC/StdLib/Malloc.c: Revert cast removal to fix GCC build breakage. 2014-07-24 23:16:47 +00:00
Stdio StdLib: Simple code cleanup 2014-07-17 20:54:49 +00:00
String StdLib: Fix pointer arithmetic issues in the strncasecmp function. 2013-09-13 00:46:19 +00:00
Time StdLib: Add isDirSep character classification macro and function. Implement several Posix functions and clean up EfiSysCall.h. Align file mode handling with UEFI file protocol flags. 2011-11-30 00:52:45 +00:00
Uefi StdLib: Simple code cleanup 2014-07-17 20:54:49 +00:00
Wchar StdLib: Update Copyright Notices. 2013-12-10 22:16:57 +00:00
gdtoa StdLib: The formatting for double float values, within the gdtoa library, is improper. 2014-08-06 18:29:02 +00:00
LibC.inf StdLib: Eliminate TimerLib dependencies. 2011-11-11 00:32:31 +00:00