Masthash

#clang

My own #MD5 library in C. It's a little faster than openssl, probably because it's less general (but it still handles any string length). Mainly it was a good exercise to implement it. https://github.com/ednl/c/blob/master/mymd5.c

#Clang #Cprogramming #cryptography (but don't rely on this! Md5 has been cracked)

Dave Rahardja
1 day ago

#clang #ld #linker question: If I create a dylib libD.dylib that links against static libS.a, by default libD will contain a copy of all (referenced) symbols from S, and any users of libD would not need to link S to get all their needed symbols.

The problem comes along if thereโ€™s another dylib libE.dylib that *also* links against static libS.a. An executable that loads both libD and libE will now get duplicated symbols from S. Anything that should be globally unique in S will no longer be unique; there will be two copies of them.

Is there a way to make ld *not* include a copy of S in D and E (i.e. leave Dโ€™s and Eโ€™s references to symbols in S as unresolved externals)? Itโ€™s OK that users of D need to also link S; I want to make sure that thereโ€™s only one copy of the contents of S in the final executable.

The obvious answer is to turn S into a dylib as well, but I want to know if thereโ€™s actually a way to do what I want.

Arav K.
4 days ago

It turns out that it's possible to have associated types and values in #c using a few extensions supported by #gcc and #clang . The basic foundation for this is zero-length arrays: you can insert a unit-alignment zero-length array field into any `struct` or `union`, and although it won't affect the layout or storage of the type, the array element type (which can be a `struct`) can be extracted with `typeof()`.

yank, https://github.com/mptre/yank.

Yank terminal output to clipboard:

> The yank(1) utility reads input from stdin and display a selection interface that allows a field to be selected and copied to the clipboard. Fields are either recognized by a regular expression using the -g option or by splitting the input on a delimiter sequence using the -d option.

Looks so easy to use. Great idea!

#clang #terminal #clipboard

Yank running live.
Julien M.
2 weeks ago
#CLang #Programming
Library of #Generic and #TypeSafe containers in pure #C language ( #C99 or #C11 ) for a wide collection of container (comparable to the C++ STL).
https://github.com/P-p-H-d/mlib

Progress on Bounds Checking in C and the Linux Kernel, https://outflux.net/slides/2023/lss-na/bounds-checking.pdf.

Talk given by @kees and @gustavoars at the Linux Security Summit 2023.

Agenda:

โ€ข Goal: Memory safety
โ€ข 50 years of missing bounds checking
โ€ข Problems with existing work-arounds
โ€ข Current mitigations lack sufficient coverage
โ€ข Improve coverage: Refactor for unambiguous arrays
โ€ข Improve coverage: Annotate dynamic array sizes
โ€ข Compiler work
โ€ข Metrics

Really impressive work. Congrats!

#linux #safety #clang

About 300 installs of my Flipper resistance calculator app, now. I'm really happy about that ๐Ÿ˜Š https://flipc.org/instantiator/flipper-zero-experimental-apps?branch=main&root=resistors
#FlipperZero #Resistance #Electronics #App #Embedded #C #clang

A screenshot showing the entry on flipc.org for the Resistance Calculator app (an app for Flipper Zero).
Uli Kusterer
1 month ago

I am kinda sad that #clang knows to say "unimplemented pure virtual method X in class Y", but doesn't have a Fix Me yet to actually add that method.

OTOH, it gives you the class name now. That's great! <3

Off the back of my experience writing apps for the #FlipperZero, I've put together a tutorial for first-time app #devs

1/ Part 1: Getting started
https://instantiator.dev/post/flipper-zero-app-tutorial-01/

#C #clang #ufbt #vscode

A flipper zero showing the Resistance Calculator app. It has an illustration of a resistor with one of the bands highlighted. Below each band is a 2-letter code indicating its colour. Above the resistor is a calculation of the resistance and tolerance based on the colours.

The flipper zero itself is a cute, angular device small enough to fit in the palm of your hand. It has a white moulded shell with an orange backlit LCD screen, an orange 5-directional pad and a little orange back-button. It's adorable!

Found in string.h in the #FlipperZero firmware... ๐Ÿ˜‚๐Ÿงก
#c #clang #comment #code #community #xp

A comment, found in the code of string.h: "Lasciate ogne speranza, voi chโ€™entrate"
That comment, put through Google Translate, comes out as: "Abandon all hope, you who enter"
Jan <3 :gopher: ๐Ÿ›น
1 month ago

Does someone know a good #rtf #richTextFormat parser in #golang #clang #rust or any other compiled language? One, which can handle symbols like รœ correctly? #kotlin would be fine as well

oh, and of course the original PR from Derek Jamison to help fix a crash caused by an unexpected pointer type bug! https://github.com/instantiator/flipper-zero-experimental-apps/pull/1
#FlipperZero #BugHunting #Bugs #C #clang #developer #community

Also, a pull request from hedger that adds the official ufbt GitHub Action. Super kind ๐Ÿ™ https://github.com/instantiator/flipper-zero-experimental-apps/pull/8
#developer #community #C #clang #ufbt #FlippzerZero #BuildTools #GitHub #GitHubActions

Beej
1 month ago
Daniel Paoliello :rust:
1 month ago

And the second change that adds CodeView debug info for jump tables: https://reviews.llvm.org/D149367/new/
#llvm #rust #clang #cpp

Dani (:cxx: modules addict)
1 month ago

To be precise:
- msvc emits too many definitions of non-inline destructors of exported classes and requires invalid C++ to work around that. ๐Ÿ˜ฑ

- clang emits too many v-tables for non-exported (exported too?) classes that are part of exported classes with no known workaround for this issue. ๐Ÿ˜ญ

#clang @AaronBallman

Daniel Paoliello :rust:
1 month ago

Are there any #llvm contributors/reviewers on here? I'm making some changes to improve Windows (CodeView) debug info and would love for someone to have a look. First change is here: https://reviews.llvm.org/D148761
#rust #clang

Shout out and h/t to Derek Jamison who has very kindly spent time helping me out with a thorny issue in C. The project isn't ready yet, but it wouldn't have been possible to get this far without his kind help, or his #FlipperZero tutorials.

Check out: https://youtube.com/@MrDerekJamison/featured

#Dev #Electronics #Tutorial #clang

A Flipper Zero (a small, white plastic, slightly angular device with an orange screen and a few orange buttons) lays on a wooden table. It is showing a screen from an app I'm working on - which shows a resistor, an arrow, and the word "uncalculated". Eventually, this will be a resistance calculator app. Derek very kindly helped me to debug issues with the code so far.
Blain Smith
1 month ago
Dani (:cxx: modules addict)
2 months ago

This is a thing now: #clang 16.0 passes my module test suite for the {fmt} library ๐ŸŽ‰

With some additions to the primary interface unit related to the C++ standard library, it compiles the BMI and runs the test in the MSYS2 environment, too.

It looks like *importing* user-defined literals dosn't work yet: the namespace is visible, but 'operator""_cf ' isn't. This test is disabled for now.

#fmt #module #cpp

log of clang 16.0 passing the modules testsuite of the {fmt} library
Uli Kusterer
2 months ago

I wonder what the difference between Swift and clang is, (which, from what I casually picked up over the years, should have been roughly the same core dev teams?) that clang's error messages are so much better than Swift's.

Was it persons who didn't come along onto the Swift team? Is it Swift's large number of syntax constructs but small number of unique syntaxes?

#swift #clang #programmingLanguages #c #compilers #parsers

9to5Linux
2 months ago
Qt Creator 10
vruz
3 months ago

Sure you read K & R, and you know the folklore about Ken Thompson and Dennis Ritchie and the rest.

But that's not really how the C programming language started, the story of C begins in England, in Oxford and Cambridge at different times, with a colleague of Alan Turing. A man who envisioned a checkers program that never came into existence, dreamt of a language that never came into being.

And yet, somehow...

https://arstechnica.com/features/2020/12/a-damn-stupid-thing-to-do-the-origins-of-c/

#C #compsci #programming #retrocomputing #clang #bcpl

Bernie
3 months ago

I heard that Apple and Google pulled out resources from #clang to focus respectively on Swift and... what was it called... Carbon? I wish them the same blazing success of Google Plus. ๐Ÿคฆ
@simontoth #cpp #programming

#LLVM 16.0.0 has entered #Gentoo yesterday. Notably, #Clang 16 is more strict than before. If you're using it as a system compiler, then you may hit breakage, including silent misconfigurations.

If you can, please help verifying the bugs filed against our Clang 16 tracker and possibly fixing them or marking the reported configure checks as false positives (QA_CONFIG_IMPL_DECL_SKIP) appropriately:
https://bugs.gentoo.org/870412

Bernie
3 months ago

LLVM and Clang 16 are out with more complete C++23 and C23 support.
https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html

I wonder if "import std" is finally usable in a real-world codebase?

#cpp #cpp23 #c23 #clang #llvm #programming

NLnet Labs
3 months ago

Our superfast #DNS zone file parser now has fallback functionality to support architectures for which no #SIMD
implementation is available yet. #OpenSource #clang https://github.com/NLnetLabs/simdzone/commit/88028c6e96ffe0fa85fb2c54fced7b4517a3c303

orbifx
3 months ago

Should we use #c #cprogramming or #clang for the C programming language?

Multiple choice #poll

NLnet Labs
3 months ago

Implementing DNS-over-QUIC in Unbound is turning out to be quite an adventure, but we're making good progress! #DNS #DoQ #OpenSource #clang #SoftwareDevelopment https://github.com/NLnetLabs/unbound/commit/aa8c9c4367792c674c76181c3fbfdee9996e9be8

Louis Dureuil
4 months ago

In what order did you learn your #programming languages, and what years were you active with them? I'll start:

1. #Ruby 2005-2007 2013-2016
2. #CSharp 2006-2012
3. #AdaLang 2010-2012
4. #CLang 2010
5. #Java 2011
6. #Python 2011-2022
7. #CPlusPlus 2011-2022
8. #RustLang 2016-

NLnet Labs
4 months ago

This Saturday in the #DNS Devroom at @fosdem Jeroen will be presenting his work on simdzone, a fast and standards compliant DNS zone file parser. ๐Ÿš€

Running simdzone on an Intel Core i7-1065G7 against an older .com zone file of 12482791271 bytes under Linux (Fedora 37).

GCC 12.2.1, release mode:

$ time ./parser ../../zones/com.zone
parsed 341535548 records

real 0m17.755s
user 0m16.602s
sys 0m1.105s

#clang #FOSDEM #FOSDEM23 #SoftwareDevelopment # #SIMD

https://github.com/NLnetLabs/simdzone

Hurrah, our #TubularBell has been retrieved from the lift shaft it was dropped down!!

We were rehearsing in a school back in October and had a *bit of an accident when moving the percussion equipment back to the van... The bell made an almighty #clang as it rattled down the void!

Thankfully the school called an engineer and 3 months later the bell has been retrieved in one (straight!) piece. We no longer have to hear DONG DONG (..?..) DONG! ๐Ÿ˜„

#TubularBells #MusicFail #Music #Percussion #Funny

A single Tubular Bell laid out on a table, looking remarkably pristine after its adventure!
A set of Tubular Bells with a gap where one note is clearly missing....
Dave Rahardja
5 months ago

Hello #llvm #clang #objectivec #ObjC folks! What is the significance of the `__got` section in the executable binary? I stumbled upon it when looking at the new objc_msgSend stubs output. https://github.com/llvm/llvm-project/issues/56034

I'm a #c newbie- c has no equivalent of async/await? Not at the language level nor the library level?

#clanguage #clang

Tom Lyon โœ…
6 months ago

By popular demand, I have scanned my copy of Draft #1 of #Kernighan and #Ritchie's C Programming Language book. Here: https://drive.google.com/drive/folders/1OvgKikM8vpZGxNzCjt4BM1ggBX0dlr-y #ComputerHistory #UNIX #CLang

muirrum
6 months ago

While I'm waiting for the backup to finish, let's do an #introduction !

Howdy y'all! I'm muirrum, and I'm the administrator of social.dino.icu. By day I'm a CS/EE student, network operator, and systems administrator at my university. By night I'm a film projectionist, event producer, and (sometimes) quality code writer.

Please feel free to talk to me about #radio #gentoo #linux #film #events #rust and #clang!

Who are you (as a C person)?

#CLang

Bert Lamb
7 months ago

Here's my #introduction

I'm Bert! I've been in #Software development for a long time. I've worked on everything from embedded systems in digital cameras to autoscaling #cloud #architectures.

I learned BASIC in elementary school, Pascal in middle school, #clang in high school, and then went on to #java and now mostly #csharp, although I can find my way in just about any language.

I learned to play #hockey (poorly) as an adult and think it is the best sport out there.

Nice to meet you!