Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22014

GCC Stack overflow by negative number

$
0
0

I'm getting a very strange error msg. A negative Flash overflow. How is this possible

I'm calling a debug function to print out error msgs on multiple occasions. This error logger function looks like this

BOOLEAN C_Wrapper_Write_to_File(
    const char *const p_ch_Log_File_Name,
    const char *const p_ch_log_msg,
    const char *const p_ch_File,
    const int i_line);

I'm calling this function at multiple occasions like this

C_Wrapper_Write_to_File("debug","a veeerrryyy lonnngggg error messssssagge", __FILE__,__LINE__);

=> this one produces a flash overflow by positive 16 byte.

If I reduce the string length I'm getting a negative flash overflow

C_Wrapper_Write_to_File("debug","tiny", __FILE__,__LINE__);
../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: ../../bin/3_zellen_2017.elf section `.data' will not fit in region `FLASH'
../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by -24 bytes

Now i'm well aware that all const char[] Arrays are stored in the flash. So it makes perfectly sense to me, that when i shorten the Error the Flash usage decreases.

But until today i never got the message with a negative number. Did someone else encounter the same problem?


Viewing all articles
Browse latest Browse all 22014

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>