Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Jorengarenar
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
Jorengarenar
3y ago
No, no, no, no, no; it's the other way around. VLA are poorly defined feature for which some implementations offer additional protection. And I agree, automatic VLA aren't inherently a bad feature; it's just a poor feat
32.
▲
by
Jorengarenar
3y ago
> unsigned integer overflow is what does the wrong thing in C You may want to rethink this statement
33.
▲
by
Jorengarenar
3y ago
IIRC, there will be no more rationales
34.
▲
by
Jorengarenar
3y ago
> The main real issue is that - if the attacker can control the size of the VLA -, it is possible to overflow the stack into the heap. I think the main gripe most programmers have with VLA is lack of control over them. Fixed size array i
35.
▲
by
Jorengarenar
3y ago
I'm not sure about this example. It basically shows that if you use automatic VLA you have can do some checks on VLA. But if I prohibit automatic VLA altogether and use fixed size array, I don't need to worry about that at all and
36.
▲
by
Jorengarenar
3y ago
It's kind of amazing how many university programs teach C(++) just wrong. Wrong and outdated! Apparently, in India many schools still didn't update the curriculum and teach Turbo C!
37.
▲
by
Jorengarenar
3y ago
> People do not write makefiles anymore. We do, not every project is of scope of AAA game. Heck, I don't even know if some of our projects could be converted from hand written Makefiles to something else.
38.
▲
by
Jorengarenar
3y ago
> The overall idea that VLA are always bad is incorrect. I mean, I'm yet to see a definitive example where automatic* VLA was actually right tool for the job. I know they were supposedly introduced for the numerical analysis, but I
39.
▲
by
Jorengarenar
3y ago
VLA indeed were made optional with C11, but C23 bring some changes to this: * automatic VLA (i.e. stack allocated ones) will stay optional * VM types (e.g. VLA in function parameters) will be mandatory feature again
40.
▲
by
Jorengarenar
3y ago
> VLAs do not have extra bounds checking. Actually, they allow for some limited size checking in function parameters [0], but GCC added this feature only very recently [0]: [link redacted]
41.
▲
by
Jorengarenar
3y ago
> Warn about any use of stack-allocated variable length arrays. Unfortunately, it warns about all VLA, not only stack allocated ones. What you might want is rather: -Wvla-larger-than=0 This flag will indeed report only automatic V
42.
▲
by
Jorengarenar
3y ago
They said Brave behaves like W11...
43.
▲
by
Jorengarenar
3y ago
"Lent"?
44.
▲
by
Jorengarenar
3y ago
A dangerous sociopath with functioning moral compass? That sounds like an oxymoron, don't you think? And no, fulfilling the very bare minimum is not virtuous. When virtuous person stops being virtuous, they fall to "average",
45.
▲
by
Jorengarenar
3y ago
Omnipotence is something different from omniscience
46.
▲
by
Jorengarenar
3y ago
> > I fully agree that continually denying yourself something that makes you happy isn't a virtue. > Murder? Mayhem? Destruction? Greed? The bar is so low you consider not being a dangerous sociopath a virtue?
47.
▲
by
Jorengarenar
4y ago
It was intentionally decided that "it's not a bug, it's a feature!"
48.
▲
by
Jorengarenar
4y ago
And that "recycling" probably ought to be put in scare quotes
49.
▲
by
Jorengarenar
4y ago
OK, so Linux ISOs allegedly did suck (way) over than a decade ago; Windows ISO sucks to this day.
50.
▲
by
Jorengarenar
4y ago
Have you tried telling them "no"?
51.
▲
by
Jorengarenar
4y ago
IIRC, Microsoft "borrowed" the design from Apple Macintosh, which in turn was based on Xerox's technology. So no, they weren't the pioneers.
52.
▲
by
Jorengarenar
4y ago
>How often do you access a remote server via SSH where you share an account with your colleagues and cannot install another shell next to bash? About... almost every day?
53.
▲
by
Jorengarenar
4y ago
>When people say “debuggers are useless and using logging and unit-tests is much better,” Who? Who does say that? Freshman students who barely started coding? >I suspect many of them think that debuggers can only put breakpoints on ce
54.
▲
by
Jorengarenar
4y ago
You just like that assumed their native language?
55.
▲
by
Jorengarenar
4y ago
I mean, I titled the article "Lesser known trick, quirks and features of C". Not to mention the very first sentence: > There are some tricks, quirks and features (some quite fundamental to the language!)
56.
▲
by
Jorengarenar
4y ago
Don't mind if I do
57.
▲
by
Jorengarenar
4y ago
Hah, unfortunately this bit of "poetry" wasn't intentional. I just meant that C does care about whitespace, just not a lot.
58.
▲
by
Jorengarenar
4y ago
`volatile` is one of the things we need to pay attention to when dealing with threads, but as you notice it's not the only one. Eskil Steenberg talks about it at 12:42 in his talk Advanced C: The UB and optimizations that trick good p
59.
▲
by
Jorengarenar
4y ago
>Also don’t assume most of them will he known by other developers. Given the title of the article, one ought to assume the opposite ;)
60.
▲
by
Jorengarenar
4y ago
The former executes loop when `i` is 0. And we cannot change the comparison to `>=` in the later, because unsigned is always bigger or equal 0, thus we would get infinite loop.
More ›