HNHacker News
TopNewBestAskShowJobs

cremno

2,647 karma · joined March 24, 2012

submissionscomments
cremno··on GCC is moving to git
GCC already has a GitHub mirror:

https://github.com/gcc-mirror/gcc

It seems out of sync though.

cremno··on Preparing Windows Server Technical Preview for Windows Containers
PS has $? (it's a boolean though) but I don't follow your comment. $? in Bash isn't comparable to $_ in PS at all, is it?
cremno··on Using the __cleanup__ variable attribute in GCC
systemd does that:

https://github.com/systemd/systemd/blob/v224/src/basic/macro...

https://github.com/systemd/systemd/blob/v224/src/basic/macro...

https://github.com/systemd/systemd/blob/v224/src/basic/util....

https://github.com/systemd/systemd/blob/v224/src/basic/filei...

cremno··on C2 Lang design (2014) [pdf]
>2. Removed keyword "static": kills one of my favorite tricks, "self-init'ing functions".

The removal of that keyword with several different meanings doesn't mean there isn't/won't be a replacement:

http://c2lang.org/site/language/variables/#local-keyword

>4. New keyword "nil": Redundant with NULL?

https://groups.google.com/d/msg/comp.std.c/fh4xKnWOQuo/IAaOe...

>5. Example - Base Types: Uses uint8 in place of char. This obscures intent and makes code less readable.

http://c2lang.org/site/language/basic_types/

C2 apparently still has char however it doesn't seem to be as weird as C's (distinct type, either signed or unsigned). Simply int8.

cremno··on Fast Ruby – A collection of common Ruby idioms
Most examples aren't really about micro-optimizations. They're more about calling the appropriate method in the first place (count vs. size/length, gsub vs. sub/tr).
cremno··on Hello Ruby – Almost there
Accessing undefined/unitialized global or instance variables (like: @i) is not an error and nil will be returned. With -w a warning will be emitted. The weird class variables must be initialized. Local variables (lexically scoped) must be defined and are default-initialized to nil. (Global and class variables are usually not used.)
cremno··on Unicode skin-tone modifiers
Is there a standardized or widespread character set with company logos or coats of arms?
cremno··on Why the 'Git'? Linus: I‘m an egotistical bastard...
It looks like a Lobsters installation:

https://github.com/jcs/lobsters

Oh, and don't click on 常见问题(慎入).

cremno··on Function overloading in C
I recommend reading the notes section and better yet the following blog entry before one decides to use _Generic with less trivial types:

https://gustedt.wordpress.com/2015/05/11/the-controlling-exp...

cremno··on Function overloading in C
Only library-wise: the reason for _Generic <tgmath.h> is missing, <complex.h> exists but can't be used. Some lesser used and sometimes useful C99 language features/changes are still unimplemented. Even excluding features C11 made optional (for good reasons) like VLA or complex.
cremno··on Charges Against Netzpolitik.org Are an Attack on the Free Press
The second link in the article is:

http://www.iuscomp.org/gla/statutes/StGB.htm#BII

It's an English translation from 1998 but § 94 StGB hasn't changed since 1975:

https://dejure.org/gesetze/StGB/94.html

cremno··on Why internationalization of commands is a very bad idea
Since at least 2.0: https://technet.microsoft.com/en-us/library/hh849703%28v=wps...

It was probably even in 1.0 but MSDN doesn't contain documentation for old software.

cremno··on Re: C as used/implemented in practice
>C has a very weak type system and very weak runtime guarantees, making it much easier to introduce problems with no indication that something's up.

Here's an interesting example I've stumbled upon a few weeks ago:

https://stackoverflow.com/questions/31037149/type-safety-for...

float _Complex -> float doesn't require any diagnostic even though the imaginary component is (silently) discarded. Clang has one (not enabled by default or -Wall/-Wextra) however current GCC versions haven't.

cremno··on Re: C as used/implemented in practice
What pitfalls do you mean (assuming 32-bit wide int and uint32_t is unsigned int as both are very common)?
cremno··on Why is my x64 process getting heap address above 4GB on Windows 8?
Yeah however the C standard recommends that the integer conversion rank of size_t and ptrdiff_t is lower or equal to long.

http://port70.net/~nsz/c/c11/n1570.html#7.19p4

cremno··on Ruby Is Defined by Terrible Tools
>but Ruby has pretty terrible support for parsing Ruby

https://github.com/whitequark/parser

Neither unmaintained, broken nor just for old versions. It has some really minor incompatibilities though:

https://github.com/whitequark/parser#known-issues

The same person also wrote a Python parser because apparently the ast module doesn't provide precise location information of tokens:

https://github.com/m-labs/pythonparser

cremno··on Show HN: Online IEEE 754 playground
Why do they even differ?
cremno··on Yet Another Language Speed Test – Counting Primes
It doesn't. A range just knows if it's exclusive, and its beginning and end value. That line is also not really idiomatic. It's just trying to be.
cremno··on GCC: Patch to change default C++ dialect to C++14
Maybe. For example, GCC 5 changed the default for C from gnu89 to gnu11 and that broke the build of some Finnish amateur project:

https://lkml.org/lkml/2014/10/19/94

That's why projects that use GCC or a compatible compiler should use the -std option to set the targeted standard and not rely on the default.

cremno··on Fun with UB in C: returning uninitialized floats
Or just read the diagnostics and fix the code (or use UBSan). Clang outputs:

>variable 'c' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

cremno··on “Systemd should not default to using time{1,2,3,4}.google.com”
>the GNU project was just about a compiler

The acronym itself is actually a big hint that this is incorrect.

https://groups.google.com/forum/#!msg/net.unix-wizards/8twfR...

>To begin with, GNU will be a kernel plus all the utilities needed to

>write and run C programs: editor, shell, C compiler, linker,

>assembler, and a few other things.

cremno··on Choosing good names
Use BigDecimal or whatever that kind of type is called in the used programming language.

http://floating-point-gui.de/basic/

http://0.30000000000000004.com/

cremno··on The Case of GCC-5.1 and the Two C++ ABIs
Syscalls are irrelevant for almost everybody programming Windows applications. I didn't write about Mac OS X.
cremno··on The Case of GCC-5.1 and the Two C++ ABIs
>For one, on some OS's (like Windows), the syscall interface is unstable

True but if someone is dealing with syscalls on Windows they're programming something very unusual.

>so you really want to use kernel32.dll and friends or you're signing up for pain.

Why? There is no pain involved unless a function that isn't implemented in older versions is imported.

cremno··on Stop Firefox leaking data about you
Yeah. I personally don't care if something is from Google but other people do. I'm quite surprised this stupid list that doesn't even explain what each setting actually does is on page 1.

(Edit: Oh, it seems it was updated in the meantime.)

cremno··on Stop Firefox leaking data about you
I think using a blocker extension like uBlock Origin restores (at least partially) this functionality without involving Google.
cremno··on Format Specifiers Checking in Visual Studio 2015
Yes, it really took them quite some time to make this a compile-time diagnostic. But before you could've used the static analyzer (/analyze). However GCC's format attribute doesn't work with wide character functions (which is important on Windows) and the produced diagnostic doesn't suggest a correction.
cremno··on Chromium will no longer download/install the Hotword Shared Module
Apparently but only if you're using Chrome and not Chromium (v45).
cremno··on Unix started with just 323 lines of code
That's incorrect. That's just because the repo owner committed each V1 file separately.

For the whole V1 source code see https://github.com/dspinellis/unix-history-repo/compare/Epoc...

cremno··on Drat – Ruby has a double splat
What makes you think they're hidden? Enumerator moved from stdlib to core in 1.9 and also calling #to_enum isn't needed anymore:

    enum = 0.upto(Float::INFINITY)
    enum.next # => 0
    enum.next # => 1
← PreviousPage 3 of 7Next →