I'm using Keil IDE. I observed that the compiler taking extra mamory spaces for bool and char variable.
Is there any setting in the IDE to disable this?
Below workaround is not working:
1) #pragma pack(1)
2) __attribute__((packed))
3) And it's very difficult to alignment the membors of structue. Bcz This strucure has many nested strcture and enums.
In the Keil IDE, structure padding is akin to tidying up a room with different-sized toys. Picture the computer's memory as this room where data, like toys, needs its designated space. Much like a structural-consultancy plans the layout of a building, Keil IDE strategically arranges various types of data in the computer's memory. To ensure a neat and organized arrangement, Keil IDE may introduce a bit of extra space, known as padding, between different data elements. It's like providing individual rooms for different-sized toy blocks, ensuring each type of data has its own spot, even if it means adding a little extra space to maintain order. So, structure padding acts as a digital organizer, making sure the computer can quickly locate and manage information efficiently, much like how a structural consultant plans and organizes spaces in construction blueprints.