@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

One of the things that pisses me off is how did these spambots even get my name, or choose me. I don't have as many followers. Why the hell am I in the crosshairs.

Fuck, man, I have to turn off notifs for this place.

shafik, to random
@shafik@hachyderm.io avatar

In other words competition works to keep prices down: https://www.bloomberg.com/news/newsletters/2024-02-22/supply-chain-latest-bloomberg-s-moving-metals-series

A lot of the inflation we have seen is 💯 linked to lack of competition in key market places. We have let too many companies get too big and we are literally paying for it.

thephd,
@thephd@pony.social avatar

@shafik Exhibit that monopolies suck, and the FTC should be taking a machine gun to every one.

thephd, to random
@thephd@pony.social avatar

Didn't think seeing @-spam here would be the thing that makes me hate this place but I guess that's it.

Not that I hate anyone on here, it's just. You know, I was hoping this platform would remain "indie" enough it'd never attract the clickbaiters and spammers. Now every instance is going to have to speedrun spamblock tech beyond "block/mute instance".

hackymix, to random
thephd,
@thephd@pony.social avatar

@hackymix @vitaut this will work until it doesn't, e.g. on Windows where char16_t and wchar_t are the same type or char32_t and wchar_t being the same types on GNU. Go to an exotic enough system and the type matcher will either assume UTF-16 where it shouldn't or UTF-32 where it shouldn't.

But other than that, looks fine enough for a C library.

thephd, to random
@thephd@pony.social avatar

another day wasted to LaTeX telling me I'm missing an item and erroring on.... exactly the item.

what an utterly inhumane language.

thephd,
@thephd@pony.social avatar

@Patricia Somebody else is already working on improving LaTeX, its called typst. Despite not having the outputs I need, its still mostly good.

thephd, to random
@thephd@pony.social avatar

You wouldn't read the first draft of the C2Y standard at wtf-o'-clock in the night,

right?

https://drive.google.com/file/d/12kNvH0aYJhe3ZPmBKH_Nk5maTfxH2lJv/view

thephd, to random
@thephd@pony.social avatar

Didn't think "writing over the edge of an array is bad and we should not do that if we can help it without relying on Undefined Behavior Sanitizer or Address Sanitizer" was going to be something I had to write about in 2024 but...

... here we are??

thephd,
@thephd@pony.social avatar

@matzipan This is actually a major argument I've been struggling to deal with in C and C++, from the lowest levels to the highest parts of the community. The contents are usually better than just writing off the edge of the array, but there seems to be a deliberate pushed to keep as many things as possible UB because UB allows "flexibility of implementation", with things like UBSan or Compiler-inserted checks as a manifestation of that.

But all I see is the wellspring of vulnerabilities that keep coming out of it, so I wish we'd at the very least provide built-in alternatives to this.

thephd,
@thephd@pony.social avatar

@dango_ even worse, but definitely fun to do!

foonathan, to random
@foonathan@fosstodon.org avatar

@thephd I've run into "flexible array member in otherwise empty struct" error (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69550).

My use case is: I want to return a value that right now is only a pointer to an array, but it may contain more data in the future, which should be stored in the same allocation. However, I can't introduce a struct yet that only contains the FAM.

Thoughts?

thephd,
@thephd@pony.social avatar

@foonathan This should be legal but C sort of refused to handle structs of 0 size, so the only help you get for this is implementation extensions.

thephd,
@thephd@pony.social avatar

@hackymix @foonathan You can easily have Zero-Sized Types without ever returning 0 for sizeof. "Every object must occupy some space, even if that space is 100% padding" is a fine and normal way to implement that, and you can easily extend that concept to only-FAMs without breaking anything.

thephd,
@thephd@pony.social avatar

@hackymix @foonathan (As a side note, you can also use that padding For Good rather than For Evil; there's no reason to not have the size of the FAM stored in the "padding" before the array itself, which in this case would be the start of the structure. Again, I don't know any that do handle it in this way but having the size inline would be nice.)

malwareminigun, to random
@malwareminigun@infosec.exchange avatar

@thephd Speaking as the C editor, would you expect this to imply that fread won't ever return a partial result if neither eof nor an error occur?

thephd,
@thephd@pony.social avatar

@malwareminigun im trying to think if a network file resource can not post eof but still do a partial read...

thephd,
@thephd@pony.social avatar

@malwareminigun gonna tentatively say Yes, You Can Rely On That Being Athe Case, I think...

thephd,
@thephd@pony.social avatar

@malwareminigun @vitaut "your implementation breaks existing valid code" is always a stronger hammer than "the standard said so" :D

thephd, to random
@thephd@pony.social avatar

"At program startup, three text streams are predefined and need not be opened explicitly …"

... does that mean they are guaranteed to be open (on a hosted implementation) or that they MAY already be open...?

thephd,
@thephd@pony.social avatar

Actually you know what I'm the Project Editor I can just Fix This into:

"At program startup, three text streams are predefined and do not need to be opened explicitly …"

problem solved.

thephd,
@thephd@pony.social avatar

@eater news to me!

thephd,
@thephd@pony.social avatar

@luis_in_brief Semi-relatedly to this I'm actually working on a bunch of linters so that we can stop accidentally committing ISO House Style faux-pas in our specification.

Asides from running the normal linter on it (my eyeballs (they do not do a good job)).

thephd,
@thephd@pony.social avatar

@eater I think at that point we've firmly left the standard's guarantees and we've entered into "you have managed to inject runtime UB into somebody else's program", which I don't think the standard covers, hah...!

Nevertheless, I see what you mean. I don't think we game this sort of scenario out; C and C++ are not aware of what other programs do, beyond what the implementation provides for (and thus is necessarily implementation-defined).

thephd, to random
@thephd@pony.social avatar

Y'all. This coffee machine broke down in this place and from the back entryway the most butch lass decked in heavy tool-laden belts, hand-repaired headphones, a weighty backpack and the most relaxed work fit just walked in. And.... and.

Lesbians, I get it.

thephd,
@thephd@pony.social avatar

how could i have not known this whole time.

thephd, to random
@thephd@pony.social avatar

Only 2 more big fat ugly changes to make to the standard and then I ship this fucking C23 DIS out of here AND THEN NEVER TOUCH IT AGAIN (I hope (please (god i am so tired (pls be done plsplsplslpspls))))

thephd, to random
@thephd@pony.social avatar

LaTeX top2 worst programming languages for SURE.

Ain't no way this is what we settled on typst cannot come fast enough!!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • HellsKitchen
  • khanakhh
  • InstantRegret
  • Durango
  • magazineikmin
  • Youngstown
  • rosin
  • everett
  • slotface
  • tacticalgear
  • mdbf
  • kavyap
  • thenastyranch
  • DreamBathrooms
  • bokunoheroacademia
  • rhentai
  • cisconetworking
  • GTA5RPClips
  • ethstaker
  • osvaldo12
  • tester
  • modclub
  • normalnudes
  • Leos
  • cubers
  • relationshipadvice
  • lostlight
  • sketchdaily
  • All magazines