Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×

Comment Re: Eugenics (Score 1) 93

Abortion, of which I'm pro, is already a step towards eugenics. In 200 years, many diseases will have ceased to exist because of this.

Down's Syndrome has already been reduced over 90% in Europe, and by about 70% in America. The American parents almost certainly include a number of hypocrites, since 44% of Americans think abortion should be illegal.

Down syndrome happens by change so it will not cease to exist in the future just by having abortions today.

Comment Re:There's a very cool live version also (Score 4, Insightful) 179

shell scripts are great. They are flexible, powerful, transparent, easily changeable, debug-able ... With systemd you have a blackbox and have to learn magic keywords. It is like windows - for idiots - not for hackers. Yes, the shell script based system sometimes was a mess. But the solution is to clean the scripts up not to replace them...

Comment Re:a pointer to VLA is a bounded pointer type (Score 1) 208

Which has nothing to do with VLAs. A regular array (or any other data struture) can also be allocated on the stack or on the heap. In both cases this can decided by the programmer (by placing the array on the stack or on the heap). I don't know of any C compiler which would allocate a VLA defined as local variable (on the stack) using malloc behind the back of the programmer.

Comment Re:That reserves memory, it doesn't add bounds che (Score 1) 208

This does not reserve memory. This declares ptr to be a pointer to an array of length 256. This is exactly what a bounded pointer is. And yes, compilers can sometimes detect out-of-bounds accesses at compile time (not only for literals) and because out-of-bounds accesses are undefined behavior, there are free to add run-time bounds checking when the pointer is de-referenced. And this is exactly what the undefined-behavior sanitizer for clang and gcc does if you use it. I know, because I fixed this for gcc because it wasn't working.

    void foo(int n, char (*buf)[n])
                    (*buf)[n] = 1;
    int main(int c, char* argv[])
                char buf[10];
                  foo(10, &buf);
    $ clang-3.5 -fsanitize=undefined -O3 c.c
    $ ./a.out
    c.c:4:2: runtime error: index 10 out of bounds for type 'char [n]'

Comment a pointer to VLA is a bounded pointer type (Score 4, Informative) 208

The funny little known fact is: C99 already has a bounded pointer type: A pointer to a variable-length array.

    void foo(int N, char (*ptr)[N])
        (*ptr)[N + 3] = 10; // undefined behaviour

Using the undefined-behaviour sanitizer, you can also have the compiler add automatic checks.

Comment Re:Did Americans visit the moon? (Score 1) 133

There is highly radioactive material in the cooliong system exactly because they had so much broken fuel pebbles (apparently caused mostly by control rods ). This was one of the major flaws with this reactor which was not anticipated. According to the spiegel (1986; 24:28-30), this specific incident the jammed pebble was not a fuel pebble but a bor-filled pebble used as moderator. During the attempt to get it free, they damaged quite a lot of (moderator) pebbles and also accidentally released cooling gas (helium) from the system during an attempt to clean the pipe with it (and the cooling gas is contaminated by dust from previously broken fuel pebbles). How much radioactivity was released is unknown as monitoring equipment did not work just around this time. The new statement is that this release was not accidental but intentional because they didn't want to wait for a filtering system to arrive which would have allowed to do the cleaning without releasing unfiltered gas.

Slashdot Top Deals

Beware of all enterprises that require new clothes, and not rather a new wearer of clothes. -- Henry David Thoreau