引用: jjfuwerwer 发表于 2018-9-19 18:13
microlib 是缺省 C 库的备选库。 它用于必须在极少量内存环境下运行的深层嵌入式应用程序。 这些应用程序不在操作系统中运行。microlib 不会尝试成为符合标准的 ISO C 库。
microlib 进行了高度优化以使代码变得很小。 它的功能比缺省 C 库少,并且根本不具备某些 ISO C 特性。某些库函数的运行速度也比较慢,例如,memcpy ...
本帖最后由 moyanming2013 于 2015-3-29 17:35 编辑
我指勾不勾选microlib跟memset是否有问题基本无关。我倒认为,勾选了microlib反而会增加出问题的几率。如果代码空间够用,最好别勾选microlib。下面是使用microlib需要注意的一些问题(包括但不限于这些):
Microlib is not compliant with the ISO C library standard. Some ISO features are not supported and others have less functionality.
Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic.
Microlib is highly optimized for small code size.
Locales are not configurable. The default C locale is the only one available.
main() must not be declared to take arguments and must not return.
Microlib provides limited support for C99 functions.
Microlib does not support C++.
Microlib does not support operating system functions.
Microlib does not support position-independent code.
Microlib does not provide mutex locks to guard against code that is not thread safe.
Microlib does not support wide characters or multibyte strings.
Microlib does not support selectable one or two region memory models as the standard library (stdlib) does. Microlib provides only the two region memory model with separate stack and heap regions.
Microlib does not support the bit-aligned memory functions _membitcpy[b|h|w][b|l]() and membitmove[b|h|w][b|l]().
Microlib can be used with either --fpmode=std or --fpmode=fast.
The level of ANSI C stdio support that is provided can be controlled with #pragma import(__use_full_stdio).
#pragma import(__use_smaller_memcpy) selects a smaller, but slower, version of memcpy().
setvbuf() and setbuf() always fail because all streams are unbuffered.
feof() and ferror() always return 0 because the error and EOF indicators are not supported.
个人认为,为了保证代码的兼容性、可扩展性、可维护性,只在代码空间实在太大且不违背上述局限性时再考虑使用microlib优化空间的问题。
引用: jjfuwerwer 发表于 2018-9-19 18:13
microlib 是缺省 C 库的备选库。 它用于必须在极少量内存环境下运行的深层嵌入式应用程序。 这些应用程序不在操作系统中运行。microlib 不会尝试成为符合标准的 ISO C 库。
microlib 进行了高度优化以使代码变得很小。 它的功能比缺省 C 库少,并且根本不具备某些 ISO C 特性。某些库函数的运行速度也比较慢,例如,memcpy ...
本帖最后由 moyanming2013 于 2015-3-29 17:35 编辑
我指勾不勾选microlib跟memset是否有问题基本无关。我倒认为,勾选了microlib反而会增加出问题的几率。如果代码空间够用,最好别勾选microlib。下面是使用microlib需要注意的一些问题(包括但不限于这些):
Microlib is not compliant with the ISO C library standard. Some ISO features are not supported and others have less functionality.
Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic.
Microlib is highly optimized for small code size.
Locales are not configurable. The default C locale is the only one available.
main() must not be declared to take arguments and must not return.
Microlib provides limited support for C99 functions.
Microlib does not support C++.
Microlib does not support operating system functions.
Microlib does not support position-independent code.
Microlib does not provide mutex locks to guard against code that is not thread safe.
Microlib does not support wide characters or multibyte strings.
Microlib does not support selectable one or two region memory models as the standard library (stdlib) does. Microlib provides only the two region memory model with separate stack and heap regions.
Microlib does not support the bit-aligned memory functions _membitcpy[b|h|w][b|l]() and membitmove[b|h|w][b|l]().
Microlib can be used with either --fpmode=std or --fpmode=fast.
The level of ANSI C stdio support that is provided can be controlled with #pragma import(__use_full_stdio).
#pragma import(__use_smaller_memcpy) selects a smaller, but slower, version of memcpy().
setvbuf() and setbuf() always fail because all streams are unbuffered.
feof() and ferror() always return 0 because the error and EOF indicators are not supported.
个人认为,为了保证代码的兼容性、可扩展性、可维护性,只在代码空间实在太大且不违背上述局限性时再考虑使用microlib优化空间的问题。
举报