# Why GCC and Clang Defy Standard C++ Rules on Function Linkage

Original title: Neither GCC nor Clang are compliant with standard C++

> Hacker News story 48970039 · language: en · submitted 2026-07-19
> Web version: https://zeli.app/story/48970039
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 49 · by [birdculture](<https://news.ycombinator.com/user?id=birdculture>) · 💬 58
[original](<https://sebsite.pw/w/20260708-badstdcxx.html>) · [HN discussion](<https://news.ycombinator.com/item?id=48970039>)

## Summary

I discovered that GCC and Clang ignore the C++ standard's rule that function types with different language linkages must be distinct. This oversight causes type mismatches and compilation errors where none should exist. I argue the standard is flawed, not the compilers, since changing their behavior would break the ABI while C and C++ calling conventions are identical on most platforms.

## Key quote

> IMO the blame here doesn't lie on GCC or Clang; it lies on the standard.

## HN discussion (58 comments)

### [kloop](<https://news.ycombinator.com/item?id=48970711>)

> Give how default gcc and clang are, along with the recommendation to update the standard instead of gcc and clang, it sounds like the standard is noncompliant with standard C++
>
> Standard in the sense of commonly used or supplied

### [jdw64](<https://news.ycombinator.com/item?id=48970640>)

> But looking at this, it seems like something similar happened 12 years ago[1]. Why hasn't it been changed?
>
> [1]https://cplusplus.github.io/CWG/issues/1555.html

### [Fudgel](<https://news.ycombinator.com/item?id=48972363>)

> https://archive.md/lBvFq

### [dataflow](<https://news.ycombinator.com/item?id=48973642>)

> \> gcc and clang can't change their behavior because that would be a breaking ABI change
>
> It's an API change. Breaking source code is generally an even bigger deal than breaking binary compatibility.

### [rurban](<https://news.ycombinator.com/item?id=48984950>)

> It's about language *linkages*, not about extern "C" vs C++ linkage.
>
> It's about stdcall, cdecl, fastcall, vectorcall, watcall, and other calling conventions, which should be in the type. And they are.

---

## Cite

- Page: https://zeli.app/story/48970039
- Date: 2026-07-19
- Source: sebsite.pw (https://sebsite.pw/w/20260708-badstdcxx.html)
- Hacker News: https://news.ycombinator.com/item?id=48970039

## Other languages

- zh: https://zeli.app/zh/story/48970039 · markdown: https://zeli.app/zh/story/48970039.md
- ja: https://zeli.app/ja/story/48970039 · markdown: https://zeli.app/ja/story/48970039.md
- ko: https://zeli.app/ko/story/48970039 · markdown: https://zeli.app/ko/story/48970039.md
- de: https://zeli.app/de/story/48970039 · markdown: https://zeli.app/de/story/48970039.md
- es: https://zeli.app/es/story/48970039 · markdown: https://zeli.app/es/story/48970039.md
