abcminiuser / dmbs

Dean's Makefile Build System - making MAKE easier.
51 stars 18 forks source link

Some C++ fixes #17

Closed jacquesg closed 6 years ago

jacquesg commented 7 years ago

This adds -fno-exceptions for C++ files and makes -fpack-struct only applicable to C files.

NicoHood commented 7 years ago

Why dont you want to use -fpack-struct in c++ files?

jacquesg commented 7 years ago

You very quickly end up with:

warning: ignoring packed attribute because of unpacked non-POD field

In general, IMHO packing a struct should be done on a per struct basis. I understand that this is typically what you want for a small MCU's, but it does make it hard to mix static libraries built with another build system due to the (potential) ABI difference.

NicoHood commented 7 years ago

@jacquesg that makes sense to me. However who uses unpacked structs? Does it even make sense to not pack structs in c++? In general I'd agree to your argument, but on avr I dont see why you not want to pack structs, especially because we are on an 8 bit system.

NicoHood commented 7 years ago

How about also adding -fno-threadsafe-statics to CPP_FLAGS? From what I saw this really makes sense. The option also safes space for my code.

jacquesg commented 7 years ago

Sounds fair, updated.

NicoHood commented 7 years ago

nice :)