←back to thread

387 points pedro84 | 3 comments | | HN request time: 0s | source
Show context
Animats ◴[] No.14860964[source]
C's lack of array size info strikes again:

    memcpy(current_wmm_ie, ie->data, ie->len);
where "ie" points to data obtained from the net.
replies(2): >>14861129 #>>14861284 #
revelation ◴[] No.14861129[source]
C's lack of arrays strikes again. They are essentially syntactic sugar.
replies(1): >>14861235 #
frlnBorg ◴[] No.14861235[source]
What do you mean by C not having arrays?
replies(5): >>14861254 #>>14861256 #>>14861257 #>>14861262 #>>14861281 #
pmontra ◴[] No.14861281[source]
They are a pointer and an offset with no validation of bounds. But that's OK: C is little more than a high level assembly.
replies(1): >>14861607 #
1. armitron ◴[] No.14861607{3}[source]
I hate the term "high level assembly" when applied to C since it's loaded against assembly (in the sense of C as its superset) which is obviously not true.

C is full of undefined behavior, assembly is not.

replies(2): >>14863893 #>>14864773 #
2. pmontra ◴[] No.14863893[source]
High level != Superset

Actually we often give up features and specialize with high level languages. That's why there are things easier to do in Ruby than in C++ and vice versa.

They are all (usually much more convenient) subsets of assembly.

3. antoinealb ◴[] No.14864773[source]
What ? Assembly has undefined behavior, for example wrt unaligned access on some processors.