@thephd@pony.social
@thephd@pony.social avatar

thephd

@thephd@pony.social

🎇 Somehow Is A C Expert ✨ Smooches Unicode-kun 💕 The C Standard Cannot Be Replaced And Will Never Be Destroyed. 🧟‍♀️ Pixel Art is Cool ✨ Banner

This profile is from a federated server and may be incomplete. Browse more on the original instance.

thephd, to random
@thephd@pony.social avatar

... Hrm. I could do something cursed and make it so passing NULL to a function for the size of a pointer-to-string argument makes it automatically do strlen on the string to get the size instead. The NULL for the input size serves no other purpose....

thephd,
@thephd@pony.social avatar

For those wondering, here's the mockup of what it does (right now, passing NULL for the input size is a runtime constraint violation, which in normal terms is "you fucked up, it's UB idiot"):

thephd,
@thephd@pony.social avatar

@tthbaltazar Added to the thread to illustrate what I mean.

soatok, to random
@soatok@furry.engineer avatar

My Signal Username:
soatok.45

Fuck Telegram

thephd,
@thephd@pony.social avatar

@soatok Is... is it possible to set up group chats on Signal?

thephd,
@thephd@pony.social avatar

@soatok Wonder how feasible it would be to have a big group like Furry Technologists or similar over there....

thephd, to random
@thephd@pony.social avatar

Despite my best wishes,

I am back to editing this document.

thephd,
@thephd@pony.social avatar

Less shitpostily: I actually loathe the ISO process. One day I'll make my gripes known, but that's not today I guess.

thephd,
@thephd@pony.social avatar

@olafurw I actually want to rewrite the document in typst.

thephd,
@thephd@pony.social avatar

Figured out a way to use the nested bookmarks in the PDF to find out where a hanging paragraph might be (and fix it).

Problem: there's fucking over 200 of these things to check. My wrist is going to fucking die.

thephd,
@thephd@pony.social avatar

"No hanging paragraphs" gotta be top 2 dumbest document rules to be dealing with.

Yeah sorry I had this one explanatory sentence my bad I'll add a whole ass new section just for this ONE SENTENCE,

thephd,
@thephd@pony.social avatar

Can't wait until this is over so I can add stable tags so I don't have to deal with

🥺

👉👈

p-pwease be careful with the fixes it will change the clause and s-subclause numbering uwu...

thephd,
@thephd@pony.social avatar

@amanjeev Nope, this is pure, manual, self-driven masochism!!

thephd,
@thephd@pony.social avatar

@gaycodegal It doesn't yet. (I have to add them myself, soon.)

thephd,
@thephd@pony.social avatar

Things that make me want to blow up Annex H:

  • ❌ Divisive nature in C Community
  • ❌ Only 1 big vendor ships a (mostly) conforming version
  • ✅ I have to fix the dinky hanging paragraphs in every duplicated Annex H clause! 😩👎

Abolish Annex H!!!!!!!!

thephd,
@thephd@pony.social avatar

My brain is so fried editing this stupid document I said "Annex H" here instead of "Annex K", which is the Bounds-checking one.

thephd, to random
@thephd@pony.social avatar

I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document again I don't want to edit this document ag

thephd, to random
@thephd@pony.social avatar

One day, things'll calm down and people will be normal.

One day.

thephd, to random
@thephd@pony.social avatar

And this is only one of the Forbidden Magic Words I have to cull out.

I'm so tired, man.

thephd,
@thephd@pony.social avatar

@krans I think we managed to agree not to do the font thing (I don't have access to a Font License from Microsoft for Calibri & friends, lmao) but for now I just have to fix the whole standard of all of its verbal forms. No imperatives/requirements in Notes/Recommended Practice/Footnotes, so no "may" or "have to" or any of that. Some of the weirder stuff like "you cannot have subheadings in bold, or any bold in the document at all" we're also pushing back on because we'd have to rewrite the whole damn document if that was a requirement!

I just wish this stuff was communicated earlier in the process. Or maybe it was and nobody really passed this information down to me as the next editor? Though, to be fair, I never asked, just assumed things were mostly okay concerning the process...

thephd, to random
@thephd@pony.social avatar

👀 String buffer type in C...?

https://open-std.org/jtc1/sc22/wg14/www/docs/n3250.pdf (It's a long paper. You can skip the rationale bits if your brain has been turned on for the last 2 decades and you don't need your hand held through why this is a Good Idea In General, but reading it is still enlightening!)

This paper is not how I would do it, but that's because I want 2 things:

  • some of what is contained in this paper, for exactly what is described in this paper
  • some of what is contained in this paper, but with no alloc/ownership (manipulation of substrings, etc.)

Before I want to even tackle this question, though, I need to have a language-based span in C (Walter Bright's char meow[..]; stuff) so we can just work with memory slices like normal people and not like insane jerks. So I probably will be neutral/abstain when voting on this, even if I kind of like it. I think it's API would be far stronger if we had slices in the language first. Of course, I don't want to be all "you can't make improvements until I make MY improvements, first!!" on the proposal...!

thephd,
@thephd@pony.social avatar

@Paxxi It's as footgunny as every other pointer + size abstraction in C, so I'm unsure what would be the thing that moves the needle in that regard for a slice type?

asociologist, to random
@asociologist@mastodon.social avatar

Each of these headlines feels like a form of genocide denial. Israel issues the warning and pushes the story to try to get credit for warning civilians, but those civilians have nowhere safe to go (and Israel hasn’t respected the last many purported safe zones). But the headlines keep coming.

Is that too cynical?

thephd,
@thephd@pony.social avatar

@asociologist No, it's unfortunately accurate. :/

thephd, to random
@thephd@pony.social avatar

... Wow, okay. So that cool/weird thing where an artist is in the same public space as you, and they draw you while you're not looking. They... I got drawn?? By this really hot lady artist???? While I was making phone calls/searching online?

AND IT'S REALLY GOOD, TOO!!??!?!

Also, the drawing going (* point *) 🏳️‍🌈🌈! and just hanging it over my shirt, lmao.

I made it, I've been Assigned Gay At Render Time. I'm officially cool now!!!!!

Also.... huh. I... I look kinda.... good--? Almost... h-handsome?!?

This artist did a phenomenal job making me look amazing, lmao.

thephd,
@thephd@pony.social avatar

(tbh, they made me look way better than I do on the day to day.)

But this was super nice of them! And then like a fever dream, the artist just... walked out of the café. And disappeared into thin air.

Not sure what to make of this whole shindig, tbh but thank you random artist, this is so sweet and nice and djkfseklgjekgewingew!!!!

18+ sebastian, to random
@sebastian@jittr.click avatar

i was nerd sniped in -soc

so, take the declaration typeof((puts("1"), (int (*)[(puts("2"), 1)])0)) a[(puts("3"), 1)], b[(puts("4"), 1)];

(the actual declaration sent in -soc is slightly different, but this is a somewhat simplified version)

when this runs, what should be printed?

i still don't know the fucking answer
the c standard makes it so difficult to find an answer to this question that isn't ambiguously worded, if there is any answer at all

here's what i've gathered from my interpretation of the standard:

  • full expressions are sequenced with respect to one another
  • initializers which aren't part of compound literals are full expressions
  • an implicit full expression is created to evaluate the sizes of arrays in a variably modified type
  • within a variably modified type, evaluations are unsequenced
  • in a declaration, a type consists of the type on the left, as well as the declarator
  • the operands of a comma expression are sequenced with respect to one another
  • the operand of a typeof expression is evaluated if the type is variably modified
  • the type name in a cast expression is "evaluated" whenever the cast expression is evaluated

some of the stuff above i'm still not 100% sure about. specifically:

  • the declaration i'm using doesn't have initializers, but i don't see anything about ordering of the "evaluation" of declarators. however, the spec says in a note that "a full declarator for a variably modified type" is a full expression, which, ??? declarators aren't expressions? how can a declarator be a full expression if it isn't even an expression? but either way, this implies that the declarators are evaluated in order
  • the thing about types in declarations being the type on the left and the declarator is just inferred by me. i can't find anything that explicitly says that. so idk what it even means to evaluate the implicit full expression of a variably modified type in this context. so i assume that the type on the left should be evaluated twice; once for each declarator? but it's unclear
  • this isn't even really relevant, but the standard says "the evaluations of the initialization list expressions are indeterminately sequenced with respect to one another", but it never defines what an "initialization list" is. it defines "initializer list", it only ever uses the term "initialization list" in one place (outside of annex j "portability issues")

the conclusions i can draw from my interpretation of the standard are:

  • 3 and 4 are printed once
  • 3 is printed before 4
  • 1 is printed before 2
  • 1 and 2 are printed twice; once for each declarator
  • the printing of 1 and 2 is unsequenced with respect to 3 and with respect to 4

so therefore, the order should be one of:
1 2 3 1 2 4
1 2 3 4 1 2
3 1 2 1 2 4
3 1 2 4 1 2

neither gcc nor clang prints any of the above though. in fact, both gcc and clang only print "2" once(!!!) but "1" is printed twice! which, like, i can't find any way to justify that, even with all the ambiguities???

clang prints 3 1 2 4 1
gcc prints 1 2 3 1 4

both of these seem reasonable, except for the missing 2. but interestingly, with some minor tweaks to the declaration, gcc instead prints 2 3 1 4 1:

int a[1];
typeof((puts("1"), (int ()[(puts("2"), 1)])&a)) (*b)[(puts("3"), 1)], (*c)[(puts("4"), 1)];

so now 2 is being printed first, before 1! which... idk, i guess if the puts("2") is part of the "type", which is evaluated before the actual typeof expression?? but i feel like that's not right??? because there's still a comma expression, and both operands of the comma expression must be evaluated everytime the comma expression is evaluated, and the first operand must evaluate first. so, like, what the fuck

is there some undefined behavior i'm missing here? i don't think there is?
is this a bug in gcc and/or clang? i don't feel comfortable saying that it is, because i imagine the gcc/clang authors know a lot more than i do, and both gcc and clang behave the same with -O0 as with -O3
wtf is going on here

thephd,
@thephd@pony.social avatar

@sebastian (I apologize: you never asked for this obscene infodump. Someone just pointed me to your posts, and I couldn't help myself, hAAAH. Feel free to ignore me. :p)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Leos
  • rosin
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • tacticalgear
  • slotface
  • Durango
  • khanakhh
  • kavyap
  • megavids
  • everett
  • vwfavf
  • normalnudes
  • osvaldo12
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ngwrru68w68
  • anitta
  • provamag3
  • tester
  • modclub
  • JUstTest
  • All magazines