Search the Community
Showing results for tags 'gcc'.
Found 2 results
I am trying to cast a u32* to u8*. This only works correctly if the u8* is on 4 byte boundary. For example, u32 num = 0x01020304; u8 *ptr = # u32 *pUn0 = (u32 *)(ptr + 0); u32 *pUn1 = (u32 *)(ptr + 1); u32 *pUn2 = (u32 *)(ptr + 2); pUn0 = pUn1 = pUn2, This is not the desired behavior. gcc has some Microblaze options but nothing that relates to this. Is there a compiler option, pragma, etc that could modify this behavior? Or is there an option in the Vivado Block Design, I could change? Thx
hi there, I have a question about code optimization with MPLAB/gcc. I have a part of code which is not working while optimization is set to level 1. So I added this pragma: #pragma optimize 0 //Some code... #pragma optimize 1 Now it is working if I set optimization to level 1 in the MPLAP gcc preferences for this project. But my question is, what is the gcc doig, if I set optimization to level 0 I the gcc settings? Is it in this case anyways doing optimization with level 1 after using this pragma? How long is this pragma setting valid, only for this .c or .h file, or for the complete project, ...? Or how could I manage this, to set the optimization level back to the level it had before setting it to 0?