Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
_kst_
3y ago
https://xkcd.com/1053/
92.
▲
by
_kst_
3y ago
Sorry, I managed to miss the context.
93.
▲
by
_kst_
3y ago
No, _Bool is a distinct type, introduced by the 1999 edition of the standard.
94.
▲
by
_kst_
3y ago
C has had _Bool natively since the 1999 ISO standard (24 years ago). The standard header <stdbool.h> has "#define bool _Bool". (The ugly name "_Bool" was chosen to avoid conflicting with existing code.) The upcomin
95.
▲
by
_kst_
3y ago
True -- but how does that affect the semantics? Both definitions say that undefined behavior can be dealt with by "ignoring the situation completely with unpredictable results". There are no restrictions on what can happen. (The s
96.
▲
by
_kst_
3y ago
Step 1: Define just what "portable assembly" actually means. An assembly program specifies a sequence of CPU instructions. You can't do that in a higher-level language. Perhaps you could define a C-like language with a more s
97.
▲
by
_kst_
3y ago
The definition of "undefined behavior" did not change in the way you describe between C89/C90 and C99. In both editions, one possible consequence of undefined behavior is "ignoring the situation completely with unpredict
98.
▲
by
_kst_
3y ago
C is not a "portable assembler". An assembly language program specifies a series of CPU instructions. A C program specifies runtime behavior. That's a huge semantic difference.
99.
▲
by
_kst_
3y ago
I recently filled out a web form on a state government site that asked me to enter the name of my immediate supervisor at my previous job. His last name has an apostrophe (starts with "O'"). The site gave me an error message:
100.
▲
by
_kst_
3y ago
You mean it uses `operator bool` where `bool` is the target type of the conversion, yes? I have no problem with the idea that conversions are operators. My point is that the title suggests something far more general that what the body of t
101.
▲
by
_kst_
3y ago
I admit I only skimmed the article, but it looks like the only implicit operators discussed are implicit conversions . There are plenty of implicit conversions in most languages. The C# feature being discussed is the ability to define you
102.
▲
by
_kst_
3y ago
What exactly is "c/c++"? Do you mean C and C++? Though they're obviously closely related, they're two distinct languages.
103.
▲
by
_kst_
3y ago
$ curl -s --head https://www.cs.umd.edu/~waa/414-F11/IntroToCrypto.pdf | grep last-modified last-modified: Wed, 07 Sep 2011 17:07:09 GMT
104.
▲
by
_kst_
3y ago
An octal-escape-sequence is a backslash followed by 1, 2, or 3 octal digits. '\0' is just another octal escape sequence, not a special-case syntax for the null character. "\0", "\00", and "\000" all r
105.
▲
by
_kst_
3y ago
I think you mean: return scoped_lock{foo_mux_}, foo_;
106.
▲
by
_kst_
3y ago
UUIDv7 uses a 36-bit unsigned field to represent seconds since 1970-01-01 (and optionally other fields to enable sub-second precision). It doesn't overflow until the year 4147 -- but since it's unsigned it can't represent tim
107.
▲
by
_kst_
3y ago
Floating-point time loses the ability to represent milliseconds, microseconds, and nanoseconds exactly. C already has (since the 2011 standard) `struct timespec`, a structure consisting of a `time_t` representing seconds since the epoch (ty
108.
▲
by
_kst_
3y ago
If there were a contact link on the site, I'd complain about the black on dark gray text for the examples.
109.
▲
by
_kst_
3y ago
Like many others, I've written my own correct-horse-battery-staple-based passphrase generator. "gen-password" generates random passwords, allowing your to specify length and character set. "gen-passphrase" generates
110.
▲
by
_kst_
3y ago
I did my own experiment with https://chat.openai.com/ recently. I asked it to tell me about myself, based on my GitHub profile. Its response was detailed, well written, and wrong. It told me that I had developed several too
111.
▲
by
_kst_
3y ago
> When pixels aren't scarce, [𐄒] is a menu but strictly worse. The character in the square brackets is "AEGEAN NUMBER THIRTY", U+010112. It doesn't display in my browser (Chrome on Windows). Oddly, it does display in
112.
▲
by
_kst_
3y ago
#embed will be in the C23 standard. It's not yet implemented in GCC 13.
113.
▲
by
_kst_
3y ago
I disagree that this is a fundamental thing. C++ doesn't exactly do "automatic typedef'ing of structures". The difference is that in C++, if you define a type "struct foo", you can refer to it either as "s
114.
▲
by
_kst_
3y ago
There's C90. There's also C99. As far as ISO is concerned, each edition of the C standard is made obsolete by its successor, but that doesn't impose any obligation on you or on compiler writers. If you have gcc, you can stil
115.
▲
by
_kst_
3y ago
`(char)'c'` is an expression of type char. Its size is one byte -- but the size of an expression isn't really relevant, since it's (conceptually) not stored in memory. You can assign the value of an expression to an obje
116.
▲
by
_kst_
3y ago
The representation of an object is determined by how the object itself is defined. An initializer doesn't change that. It only affects the value stored in the object when it's created. A special case exception is that an array obj
117.
▲
by
_kst_
3y ago
word is of type char*, a pointer to a (single) object of type char. The initializer means that the char object it points to happens to be the first (0th) element of an array containing 4 elements with values 'x', 'y', &#
118.
▲
by
_kst_
3y ago
In the declaration char letter = 'x'; the initialization expression 'x', which for historical reasons is of type int in C, is implicitly converted to the type of the object. `letter` is a `char` because you de
119.
▲
by
_kst_
3y ago
C certainly does have struct types. Apparently you mean something by "struct types" other than the well known C feature. Can you elaborate?
120.
▲
by
_kst_
3y ago
The bash you're seeing is a symlink to busybox, as are all busybox applets. You can configure busybox to install an applet named "bash", but it's not a full bash shell. It's basically busybox ash, with maybe a few
More ›