Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
schlupa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
schlupa
6y ago
and *((char*)mempcpy(dst, src, min(len, dstsize-1))) = 0; can be replace by ((char*)memcpy(dst, src, min(len, dstsize-1))[min(len, dstsize-1)] = 0; if you don't have mempcpy
32.
▲
by
schlupa
6y ago
It's 4 lines of code to implement it. So even if it is not available on a platform (glibc mmmh because of Dreppers stubborness), it's no problem. size_t strlcpy(char *dst, const char *src, size_t dstsize) { size_t
33.
▲
by
schlupa
6y ago
UCSD and Turbo-Pascal had it easy with the 255 byte strings. They had real strings but these were compiler extensions. Real Pascal didn't have string support and you could only work with packed array of chars of fixed size and as the l
34.
▲
by
schlupa
6y ago
Also most of the time people have serious performance regressions with strncpy() as the function overwrites with 0 all the test of the buffer. char buffer[2000]; strcpy(buffer, "hello", sizeof buffer); writes "
35.
▲
by
schlupa
6y ago
strncpy() suffers from its naming. It never was a string function in reality. It is a function to write and clear a fixed size buffer. It was invented to write filenames in the 14 character buffer of a directory entry in early Unix. It shou
36.
▲
by
schlupa
6y ago
Ryzen 7 4750G (Matisse) is Zen 2
37.
▲
by
schlupa
6y ago
Only if the President is not Trump.
38.
▲
by
schlupa
6y ago
A restaurant is a private company and if they don't want to serve blacks and jews they can completely do it. You see now how absurd that argument is?
39.
▲
by
schlupa
6y ago
What happens some times is that changes in the compiler fixes issues that were not well defined in the specification, or were bugs in the implementation. Programs that used the feature wrongly or that were in fact buggy then break when comp
40.
▲
by
schlupa
6y ago
Length (as proxy of expressiveness) of variable name should be a function of the scope of the variable. It there are only a few lines between declaration and last use of a variable a single letter name is often suffcient (i,j,k for loop var
41.
▲
by
schlupa
6y ago
What an utter bullshit article. If people can't see the technical merit of an article past the swear words, they should stop working and join their convent of choice. Weaklings.
42.
▲
by
schlupa
6y ago
It is a fuck up. Ignoring a sequence point (function call) is serious business. Probably a too agressive inlining.
43.
▲
by
schlupa
6y ago
Thank you for your tips. It's a pity that this information is not very visible on the quick start page.
44.
▲
by
schlupa
6y ago
llvm+clang v10 on Linux builds 8 GB in bin, 13GB in lib and >5 GB in tools + things here an there. That's ~30 GB. Then you need that much for the install. So hard requirement 2 x 30 GB + some slack. Last time I built it was around v
45.
▲
by
schlupa
6y ago
That's what building from source builds by default. I limited the build to X86, I don't need the cross compiling capacity There's probably a combination of options that will reduce the sizes and such, but by default it's
46.
▲
by
schlupa
6y ago
I do not choose the hardware (big bureaucratic organization). I will try the LLVM_LINK_LLVM_DYLIB and LLVM_BUILD_LLVM_DYLIB options next time. By default it builds static binaries and libraries requiring gigabytes of disk space.
47.
▲
by
schlupa
6y ago
A shared object, even if mapped in 300 running apps will be loaded only once in physical memory (at least for the code segment). Statically built binaries will have each another copy of the code that will be loaded every time the binary is
48.
▲
by
schlupa
6y ago
Building llvm+clang from source is also ludicrous. 70 GB of diskspace usage and takes an hour to build, ridiculous. It's the static linking which is the culprit here, hundred of MB big binaries are a catastrophe for cache and memory su
49.
▲
by
schlupa
7y ago
65C816 and also Motorola 6809 could set any page as 0 page (called direct page).
50.
▲
by
schlupa
7y ago
The 8 Bit guy builds a new computer around it. https://www.facebook.com/groups/CommanderX16/
51.
▲
by
schlupa
7y ago
Nope. Most modems used in the '90s using the Rockwell chipset used a 6502 derived controller which was clocked at over 60 MHz. The NDA we had to sign to get access to the source code (to just modify some strings) was from another world
52.
▲
by
schlupa
8y ago
Don't bother, it's the narcissist KingJoffrey who got no traction in the forum with his complaint of private access at module level. He shows all the symptoms of narcissism like "exaggerated feelings of self-importance, exce
53.
▲
by
schlupa
8y ago
Oh, look the annoying D forum troll KingJoffrey / DigitalDesigns / many other sock puppets.
54.
▲
by
schlupa
8y ago
or simply to have control over the code.
55.
▲
by
schlupa
9y ago
May be. TI BASIC was also limited in a lot of other ways. It didn't have ELSE and the THEN clause didn't allow for anything other than a line number as jump destination. Only one statement per line. So doing something as simple as
56.
▲
by
schlupa
9y ago
The Basic was slow for several reasons. 1. Double interpretation: As other already pointed out, the interpreter was written in an interpreted language, a kind of byte code if you prefer. 2. GROM routines: What added to the pain was that a