r/linux • Social Justice Warrior • Sep 03 '14

I'm Matthew Garrett, kernel developer, firmware enabler and former fruitfly mangler. AMA!

482 Upvotes

381 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 03 '14

[deleted]

11

u/[deleted] Sep 03 '14 edited Sep 03 '14

Zero terminated strings/arrays don't work anymore and neither does pointer arithmetic IMO.

I just tested under both gcc and clang, they work just fine. You're wrong.
Unless you have a solution which is just as fast or faster(and under absolutely no circumstances slower, no, not even by an additional instruction) then please say so.
Pointers are awesome.
I don't like the way char arrays are handled too though. Would be nice to be able to extend them at will as long as they are on stack(like C99's VLAs except without having to redefine the array size).

Ada

Developed by the US DoD in the 80's. Yeah, sure, let's replace 40 years of perfection in compilers with something slightly newer and unoptimized.

0

u/[deleted] Sep 04 '14

[deleted]

6

u/ramennoodle Sep 04 '14

If performance is the only thing that counts for you, and it sounds like, you should use assembly. Serious.

This is not true. There are many cases where optimizing compilers do a better job than hand-written assembly. And may cases where hand optimization of code isn't worth the trouble. Unless you have a really good understanding of both the hardware and why the compiled code is deficient, it is not better for performance to use assembly.

→ More replies (5)