frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

CVE-2026-111943: Compromised Intermediate Certificate Authority

https://nvd.nist.gov/vuln/detail/cve-2026-111943
184•keks24•3h ago•48 comments

Faster than earcut: triangulating 3.7M map polygons in 489 ms

https://globus.software/blog/2026/10/16/cutting-map-polygons/
61•molind•2h ago•14 comments

Jailbreaking the Switch 2

https://pepsipu.com/blog/2026-10-switch2-jailbreak-ns2jb/
115•ledoge•4h ago•36 comments

WorldTUI: I trained a 360M model to pretend to be a terminal

https://simedw.com/2026/10/21/world-model-terminal/
289•alphax314•9h ago•92 comments

The recently proposed o(n log n) integer multiplication algorithm [pdf]

https://web.maths.unsw.edu.au/~davidharvey/research/subnlogn.pdf
224•craigcitro•9h ago•161 comments

Several Linux kernel vulnerabilities accidentally posted to public mailing list

https://www.phoronix.com/news/LKML-New-Trend-Vulnerabilities
59•mrkn1•1h ago•12 comments

Security Disclosure

https://blog.railway.com/p/security-disclosure-wednesday-october-21st
496•passenger•14h ago•288 comments

Startup taps underwater volcano as energy source in "proof point" test

https://arstechnica.com/science/2026/10/startup-taps-underwater-volcano-as-energy-source-in-proof...
25•wffurr•2d ago•9 comments

Xbox wants you to pay 24 to 40 cents per hour to stream games you bought

https://arstechnica.com/gaming/2026/10/xbox-wants-you-to-pay-24-to-40-cents-per-hour-to-stream-ga...
21•entryleveljobsc•34m ago•12 comments

Claude Duet

https://claude.com/product/claude-duet
432•kuberwastaken•17h ago•393 comments

No more icons in every menu by default

https://blog.jim-nielsen.com/2026/icons-in-every-menu/
355•riffraff•2d ago•213 comments

Compromised LiteLLM 1.107.0 on PyPI Installs a Credential Stealer and Backdoor

https://safedep.io/litellm-pypi-compromise-credential-stealer-backdoor/
541•abhisek•22h ago•175 comments

Rust Style Guide

https://google.github.io/styleguide/rustguide.html
327•kaycebasques•17h ago•195 comments

GitLab critical patch release

https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released/
363•artooro•17h ago•86 comments

Using LLM for confidence scoring is a bad idea

https://rumple.github.io/blog/2026/10/20/asking-llm-for-confidence.html
116•jimauthors•1d ago•64 comments

OpenAI CLI

https://github.com/openai/openai-cli
151•armcat•6h ago•81 comments

The Robot I Didn't Expect to Build

https://spectrum.ieee.org/agility-robotics-digit-5-redesign
22•bojackh•2d ago•15 comments

PingCap TiDB Leaks

https://fulcrumsec.vg/pingcap/
371•swyx•1d ago•60 comments

What Is the Karakoram Anomaly?

https://nsidc.org/learn/ask-scientist/karakoram-anomaly-it-real
45•thunderbong•2d ago•8 comments

Meta ordered to pay $25B penalty in New Mexico Cambridge Analytica case

https://www.cnbc.com/2026/10/21/meta-new-mexico-cambridge-analytica-penalty.html
595•cbg0•18h ago•339 comments

Tiny possum and glider thought extinct for 6000 years found in remote West Papua

https://www.bbc.com/news/articles/cp814l80pw2o
231•bryanrasmussen•2d ago•51 comments

Amazon identifies Oct 17 PHP2Shell exploitation prior to public disclosure

https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitatio...
14•cubefox•25m ago•1 comments

Code is clay now

https://www.albertodenia.com/writing/code-is-clay-now
191•albertodenia•2d ago•129 comments

Beyond the &

https://lwn.net/Articles/1096028/
77•PaulHoule•1d ago•7 comments

OpenAI models are coming to Google Cloud

https://openai.com/index/openai-models-google-cloud/
302•armcat•23h ago•126 comments

DuckDB 2.0.0 LTS “Cinnamon Teal”

https://duckdb.org/2026/10/21/announcing-duckdb-200
431•nnx•22h ago•58 comments

mitmproxy adds --emudhra option

https://github.com/mitmproxy/mitmproxy/commit/169234499088fc2c414644a67efaed3d64ae2e3b
519•ahlCVA•12h ago•123 comments

Chain of Thought for Humans

https://www.boristhebrave.com/2026/10/18/chain-of-thought-for-humans/
114•ibobev•2d ago•56 comments

Today's PHP security release, and how we're strengthening security

https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-...
758•ejohnso49•20h ago•375 comments

ThinkPad I9990303 Error Catch-22

http://www.os2museum.com/wp/thinkpad-i9990303-error-catch-22/
33•userbinator•2d ago•5 comments
Open in hackernews

Detecting if an expression is constant in C

https://nrk.neocities.org/articles/c-constexpr-macro#detecting-if-an-expression-is-constant-in-c
49•signa11•1y ago

Comments

wahern•1y ago
> This works. But both gcc and clang warn about the enum being anonymous... even though that's exactly what I wanted to do. And this cannot be silenced with #pragma since it's a macro, so the warning occurs at the location where the macro is invoked.

You can use _Pragma instead of #pragma. E.g.

  #define C(x) ( \
    _Pragma("clang diagnostic push") \
    _Pragma("clang diagnostic ignored \"-Wvisibility\"") \
    (x) + 0*sizeof(void (*)(enum { tmp = (int)(x) })) \
    _Pragma("clang diagnostic pop") \
  )
EDIT: Alas, GCC is a little pickier about where _Pragma is allowed so you may need to use a statement expression. Also, it seems GCC 14 doesn't have a -W switch that will disable the anonymous enum warning.
pjc50•1y ago
It's remarkable that people will say that doing this kind of thing is better than learning a language which actually lets you enforce this with the type system.

(or even just insist that users use the version of the language which supports "constexpr"!)

oguz-ismail•1y ago
What language is that? Is it available everywhere (everywhere) C is?
mitthrowaway2•1y ago
Indeed, usually if I'm using C these days it's because I only have access to a c compiler for my target platform, or because I'm modifying an existing C codebase.
uecker•1y ago
I do not think anybody said this. The point is that these macros work for early versions of C. If you need to support early versions of C, learning another language is not a solution. If you don't have to, you can use C23's constexpr.
trealira•1y ago
C used to seem like a beautiful and simple language to me, but as I used it and learned more about it, it seemed more complex under the surface, and kind of janky as well. It's just utilitarian.
wat10000•1y ago
Learning such a language doesn’t mean I can use it.
o11c•1y ago
The problem is that no such language exists.

There are many languages that provide one particular feature that C doesn't provide, but they do this at the cost of excluding numerous other features that C widely relies on.

kjs3•1y ago
"I have no idea what problem you're trying to solve, what the constraints are, what the use cases might be, what tools are available on the platform, what the job or regulations require, what the skillsets of the people involved are, what the timeline is...but I'm absolutely, unshakably certain that I have a magic bullet that will make all your problems go away."

FTFY.

sleirsgoevy•1y ago
The Linux kernel has even a way to determine whether the expression is compile-time, WITHOUT aborting compilation in either case.

The trick is this (copied vebratim from Linux):

#define __is_constexpr(x) (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))

Explanation: if x is a constant expression, then multiplying it by zero yields a constant 0, and casting a constant 0 to void* makes a null pointer constant. And the ternary expression, if one of its sides is a null pointer constant, collapses to the type of the other side (thus the type of the returned pointer will be int*, and the sizeof will match). And if x was not constant, then the lefthand side would not be considered a null pointer constant by type inference, the type of the ternary expression will be void*, and the sizeof check will not match.

With a few more clever tricks, it's even possible to implement a compile-time "type ternary expression", like this: TYPE_IF(2 * 2 == 4, int, long). This is left as an exercise for the reader.

amelius•1y ago
This reminds me of the days when Boost was a thing. It was full of tricks like this.
usrnm•1y ago
It still is a thing, though.
cperciva•1y ago
With a few more clever tricks...

I did this with my PARSENUM macro (https://github.com/Tarsnap/libcperciva/blob/master/util/pars...) to parse strings into floating-point, unsigned integer, or signed integer types (and check bounds) using a single interface.

bobbyi•1y ago
I thought this would work:

#define C(x) (sizeof(char[x]), x)

sizeof is a compile-time operation so x need to be known at compile time.

It didn't work as expected. It turns out there is an exception and the standard says that sizeof is actually calculated at runtime specifically for variable length arrays:

> The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.