veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

293
active users

#clang

3 posts3 participants0 posts today

Very interesting video about UB (undefined behavior) in low level languages, C++, C, Rust,...

It is not black and white if you want to have performance.

Interesting viewpoint: optimizers are key to write expressive code, i.e. readable code, that produces fast binaries. But: then the compiler's optimizer requires assumptions. This leads to UB.

youtube.com/watch?v=HHgyH3WNTo

"C is a high level language based on an earlier language called B...It is designed to run under the Unix operating system (also designed and written by these people)" BYTE from Oct 1977 introduced readers to the C programming language
#Clang
Via @unix_byte

🌘 [RFC] 編譯器強化模式 - Clang 前端
➤ 為了更安全的 C/C++ 程式碼:Clang 編譯器強化模式構想
discourse.llvm.org/t/rfc-harde
本文提出在 Clang 編譯器中引入一個「強化模式」,旨在整合並簡化現有的多項安全與資安相關設定,以提升 C/C++ 程式的安全性。作者認為現有強化機制分散且文件不足,難以被使用者有效利用。新的強化模式將統一啟用多種編譯選項(如 -f, -m, -W 旗標)及預定義巨集,並可能要求使用較新的語言標準。文中探討了幾種實施方式,包括透過設定檔、新的驅動模式或單一綜合旗標,並尋求社羣對方向的建議。
+ 這個提議太棒了!長久以來都覺得 Clang 的安全設定很分散,希望這個強化模式能讓大家更容易寫出安全的程式碼。
+ 我比較擔心「使用者預期」的部分。如果啟用強化模式導致原本能編譯的程式碼突然不能編譯,使用者會不會有很大的意見?不過為了資安,這或許是必要的取捨。
#編譯器 #安全 #C++ #Clang #LLVM

LLVM Discussion Forums · [RFC] Hardening mode for the compilerThis is a joint proposal from: @AaronBallman, @shafik, @Endill, and @cor3ntin (with helpful input from others!) Safety and security of C and C++ programs has been an important issue in the ecosystem for a while. Both WG21 and WG14 are making plans on how to improve these aspects of the language from their end, but the standard is constrained by what it can talk about and the speed at which it can move. Implementations need to be the driving force behind improving this situation; we’re ultimatel...

Okay, pet used #clang. But how about #gcc ? Will #stringzilla show its full potential given that warnings were related to GCC options?

Nope! Well, it's better now, only 0.068s vs 0.1s but the standard library is still superior: 0.02s.

Never trust humans who say their product is 10x faster.

Why 10? Not 9 nor 11?

Because 10 sells best.

I like to think of Arch Linux in the same way the C programming language gives you the freedom to royally screw things up if you don't know what you're doing, and NixOS in the same way that the Rust programming language provides safety to prevent you from easily making stupid mistakes.

#Meme#Linux#ArchLinux

What I want vs what clang-format produces T_T

(No this can't be fixed, none of the 1000000 config options covers useful things, this is a whining post not a request for help. Unless you're a developer on clang-format you can't help me configure it, many have tried)

What do OpenBSD people use for static analysis of C code?

Valgrind was available for a while but it seems to have been removed now

Apparently there is something called the "Clang Static Analyzer", but I'm not sure how to actually use it (it seems you have to compile your program with specific Clang flags?)

I know there are countless other bugs in my code, but its nice to see "no leaks detected" when I do some stupid shit with void pointers :)

#openbsd#c#gcc

c/c++ devs of fediverse, what does your debugging workflow look like? I've used gdb manually a bit but it's quite laborious to set up each session. I need to be able to do step-through debugging with variable inspection.

[VS]Code and studio are very good for step through debugging once they're set up, but I'd rather avoid them altogether if possible, especially since you have to jump through a series of flaming hoops to get c debugging working in the non-telemetry open source version of code.

Any/all suggestions appreciated, other than 'use rust' #programming #clang #cpp