frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

My favourite PowerMac is a Nintendo Wii

https://virtuallyfun.com/2026/10/29/my-favourite-powermac-is-a-nintendo-wii/
91•DHowett•1h ago•13 comments

GitHub Incident with Actions, Pages, and Webhooks

https://www.githubstatus.com/incidents/pwxsjgnvrk6b
81•damontal•1h ago•29 comments

Northflank Breached

https://status.northflank.com
217•js4ever•4h ago•133 comments

A Working Nintendo in ~1GB of Qwen Weights

https://github.com/dbreunig/nesformer
101•dbreunig•2h ago•82 comments

Backdoor in Claude Code for VS Code extension on the Cursor Marketplace

https://phorion.io/blog/offical-claude-code-vsx-compromise/
532•_chall•12h ago•394 comments

Florilegium: Procedural Flowers in LaTeX

https://github.com/kevinraymond/florilegium
94•nanna•3h ago•18 comments

Breaking the open web won't stop the bad bots

https://www.techpolicy.press/breaking-the-open-web-wont-stop-the-bad-bots/
66•raybb•3d ago•23 comments

The federated code forge

https://tangled.org/blog/forge/
123•zlliang•3h ago•44 comments

Anthropic may not secure investment-grade rating after IPO, Blackstone says

https://www.ft.com/content/59383c7f-8d82-493f-bf01-d2e862a1018f
94•petethomas•1h ago•26 comments

AI isn't replacing SREs, it's deskilling them

https://newsletter.signoz.io/p/ai-isnt-replacing-sres-its-deskilling
328•dorianniemiec•3h ago•245 comments

Azure's Weakest Link – Five Full Cross-Tenant Compromises

https://www.binarysecurity.no/posts/2026/10/one-root-case
212•swq115•9h ago•38 comments

Building an AI-native engineering org

https://twitter.com/sgondala2/status/2115832070274723875
27•sgondala_ycapp•21h ago•19 comments

Blockchain intelligence firms link North Korea to $6.3B hack on Binance

https://www.npr.org/2026/10/30/g-s1-150902/blockchain-intelligence-firms-link-north-korea-to-6-3b...
124•paulpauper•3h ago•70 comments

Show HN: Spinf-serve – inference server for bulk scoring and decisions

https://github.com/spinfinc/spinf-serve
10•giarec•2h ago•0 comments

How do you take a picture of a black hole?

https://www.quantamagazine.org/how-do-you-take-a-picture-of-a-black-hole-20261029/
62•dverlaeckt80•9h ago•47 comments

Show HN: I built a multiplayer game where you're an aerial fighter cat

https://catcopter.com
46•pawelwentpawel•3h ago•23 comments

Compile-Time Dependent Types

https://thenumb.at/Syl-Intro/
43•ibobev•4d ago•11 comments

Tracks along the longest drive on another world

https://science.nasa.gov/blog/tracks-along-the-longest-drive-on-another-world/
38•shcallaway•17h ago•2 comments

The $6.3B Binance hack was pulled off in just 20 minutes

https://www.wired.com/story/the-dollar63-billion-binance-hack-was-pulled-off-in-just-20-minutes/
249•domhudson•6h ago•176 comments

Show HN: Sketch Stadium – watch your agent play Pictionary

https://sketch.wakeshift.ai/
6•ericlevine•3h ago•0 comments

Executable Archaeology: Reanimating the Heuristic Compiler (1961) and KBEmacs (1984)

https://arxiv.org/abs/2610.36341
22•abrax3141•2d ago•0 comments

Tree-mounted machines connect to web app to let users knock on wood remotely

https://www.designboom.com/technology/tree-mounted-machines-web-app-users-knock-on-wood-remotely/
4•surprisetalk•3d ago•0 comments

Why a program doesn't work when run from a batch file, but works when clicked

https://devblogs.microsoft.com/oldnewthing/20261026-00/?p=112797/
107•ibobev•3d ago•58 comments

Polymarket 1h halt after vendor compromise; affected users will be 'made whole'

https://www.nbcnews.com/business/consumer/polymarket-trading-halt-hack-wallets-rcna606405
78•theanonymousone•3h ago•24 comments

Pell Puzzles Review

https://dles.gg/reviews/pell-puzzles
16•trizoza•2d ago•3 comments

Gilgamesh by Simon Armitage review – an ancient epic is brilliantly translated

https://www.theguardian.com/books/2026/oct/20/gilgamesh-by-simon-armitage-review-an-ancient-epic-...
167•benbreen•3d ago•51 comments

Finding Panics with Call Graph Analyzer

https://tweedegolf.nl/en/blog/242/finding-panics-with-call-graph-analyzer/
59•ndr•2d ago•3 comments

Medicare Will Pay $50k for Your Heart Attack. It Should Pay $100 to Prevent It

https://www.medpagetoday.com/opinion/second-opinions/123553?trw=no
227•brandonb•4h ago•218 comments

Wasmer (YC S19) Is Hiring OS/Hypervisor Experts in Europe

https://www.workatastartup.com/jobs/98722
1•syrusakbary•12h ago

Geist Serif

https://vercel.com/blog/introducing-geist-serif
66•Zm44•3h ago•20 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.