4 ms·
Every compiler flag indicates a place where somebody failed. Those are either compiler implementators, language or standard designers, or all of them. >When c
by tester756 3y ago
Every compiler flag indicates a place where somebody failed.
Those are either compiler implementators, language or standard designers, or all of them.
>When compiling C or C++ code on compilers such as GCC and clang, turn on these flags for detecting vulnerabilities at compile time and enable run-time protection mechanisms:
>-O2 -Wall -Wformat=2 -Wconversion -Wtrampolines -Wimplicit-fallthrough \
>-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
>-D_GLIBCXX_ASSERTIONS \
>-fstrict-flex-arrays=3 \
>-fstack-clash-protection -fstack-protector-strong \
>-Wl,-z,nodlopen -Wl,-z,noexecstack \
>-Wl,-z,relro -Wl,-z,now
Christ.
- cozzyd 3y agoNo, it is just respect for backwards compatibility. Though, what might be nice is a shortcut or set of shortcuts for various recommendations e.g. -fopenssf-recommendation or something (and then you can override the parts you don't want afterwards). You could call it -fsafer but that might be too complicated to get everyone to agree on what it means...
- n_plus_1_acc 3y agoThat means in a few years, we'll get -freal_safer and -fsafer_v2
- account42 3y ago-fsafe=ossf23 Works for language standard versions ¯\_(ツ)_/¯
- infamouscow 3y agoThis kind of disdain really should be put to rest. All it does is alienate people that were on the fence, or maintain projects with different goals in mind. And besides, we'll be making similar comments about more your favorite recent languages once they're 38 years old and the field of computing changes. And if you don't believe so, you're in for a very rude awakening. I can already see the replies that refuse to understand this point.
- tester756 3y ago>And besides, we'll be making similar comments about more your favorite recent languages once they're 38 years old and the field of computing changes. And if you don't believe so, you're in for a very rude awakening. I'm not going to have a problem with critique of my $fav_lang if its designers and implementators underperform. So far they managed to do really good job after >2 decades. >This kind of disdain really should be put to rest. All it does is alienate people that were on the fence, or maintain projects with different goals in mind. I believe that languages and compilers should go way beyond just "enable things to be possible", but they also should be user friendly and be safe/sane by default. That's why I'm critiquing this chaos. Don't you see this long ass list: ">-O2 -Wall -Wformat=2 -Wconversion -Wtrampolines -Wimplicit-fallthrough \ >-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \ >-D_GLIBCXX_ASSERTIONS \ >-fstrict-flex-arrays=3 \ >-fstack-clash-protection -fstack-protector-strong \ >-Wl,-z,nodlopen -Wl,-z,noexecstack \ >-Wl,-z,relro -Wl,-z,now" It is insane. Just because someone values different things then it doesnt make it flawless.
- soulbadguy 3y ago> I believe that languages and compilers should go way beyond just "enable things to be possible", but they also should be user friendly and be safe/sane by default. Everyone one wants sane and safe default, and ease of use etc... etc... The questions here is more nuance is about should an existing ( and dare i say very successful) language navigate the need for backward compatibility with with security and UX concerns. > That's why I'm critiquing this chaos. Critiquing a design is fair. Critiquing without understanding the context and constraints around the said design is not particularly helpful and tend to rub people the wrong way. Adding platitudes like "user friendly and be safe/sane" gets old even faster. > It is insane. Not really... it's just the results of very very constrained design space. Reality is messy >
- infamouscow 3y agoYou're replying to a blog post by the OpenSSF on how to harden C and C++ programs offering nothing of substance except childish remarks based entirely on your own subjective opinions. It seems like you're replying to a field of strawmen you've constructed rather than what's being said.
- kevin_thibedeau 3y agoIt's a sign that the compiler devs value backward compatibility with earlier incarnations that lacked such programmer aids. These are features that come with an associated cost and you don't pay that price in C without explicitly choosing it.
- cozzyd 3y agoOr worse, your 30 year-old program that used to compile and work just fine no longer compiles and you now have to figure out why.