Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Ive got errors compiling code that uses certain string functions. Why?

0
Posted

Ive got errors compiling code that uses certain string functions. Why?

0

{AJ} glibc 2.1 has special string functions that are faster than the normal library functions. Some of the functions are additionally implemented as inline functions and others as macros. This might lead to problems with existing codes but it is explicitly allowed by ISO C. The optimized string functions are only used when compiling with optimizations (-O1 or higher). The behavior can be changed with two feature macros: • __NO_STRING_INLINES: Don’t do any string optimizations. • __USE_STRING_INLINES: Use assembly language inline functions (might increase code size dramatically). Since some of these string functions are now additionally defined as macros, code like “char *strncpy();” doesn’t work anymore (and is unnecessary, since has the necessary declarations). Either change your code or define __NO_STRING_INLINES. {UD} Another problem in this area is that gcc still has problems on machines with very few registers (e.g., ix86). The inline assembler code can require almost a

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123