# 使用 Homebrew, apt, dnf, MacPorts, Nix, zypper 安装 cdecl

查看 cdecl 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:cdecl
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cdecl
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cdecl
```

  证据: MacPorts ports tree: devel/cdecl/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install cdecl
```

  证据: Debian stable package indexes: cdecl from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install cdecl
```

  证据: Fedora Rawhide package metadata: cdecl from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#cdecl
```

  证据: nixpkgs package indexes: pkgs/by-name/cd/cdecl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install cdecl
```

  证据: openSUSE Tumbleweed package metadata: cdecl from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:cdecl
- **软件包管理器:** Homebrew
- **版本:** 18.7.2
- **来源摘要:** Turn English phrases to C or C++ declarations
- **主页:** <https://github.com/paul-j-lucas/cdecl>
- **仓库:** <https://github.com/paul-j-lucas/cdecl>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- c++decl (别名)
- cdecl (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 18.7.2
## 项目历史与用法

cdecl is a classic command-line helper for translating between C or C++ declarations and pseudo-English descriptions. The current maintained version also helps develop and debug C preprocessor macros.

### 项目历史

The upstream README says cdecl was originally written by Graham Ross sometime in the mid-1980s, and that Tony Hansen posted source with his changes to comp.sources.unix in 1988. The AUTHORS file records a long chain of contributors who added ANSI C, C++ declarations, GNU readline support, Apple blocks, and modern C/C++ language support.

Paul J. Lucas's maintained codebase was created on GitHub in 2017. The README says this codebase fixes deficiencies in earlier versions and adds many features, including Autotools, long options, modern C and C++ language distinctions through C23/C++26, macro expansion, better diagnostics, and extensive type support.

### 采用历史

cdecl is one of those small developer tools that survives because C declarator syntax remains hard to read. The Homebrew input records packages in Homebrew, Debian/Ubuntu, Fedora, MacPorts, Nix, and openSUSE-family packaging, matching its role as a long-running Unix developer aid.

### 使用方式

Users can run cdecl interactively, pass declarations on the command line, read standard input, or invoke it as c++decl. It explains declarations such as pointers to arrays and emits declarations from English-like commands. The current version also expands macros step by step for preprocessor debugging.

### 为什么软件包爱好者会关心

cdecl is package-nerd catnip because it carries living Unix history: mid-1980s origins, 1988 Usenet distribution, unclear inherited source licensing, and modern maintenance that teaches new C and C++ standards to an old interface. It is tiny, weird, useful, and exactly the sort of program distributions keep around.

### 时间线

- Mid-1980s: Original cdecl written by Graham Ross, according to the upstream README.
- 1988: Tony Hansen posted source with changes to comp.sources.unix.
- 2017: Paul J. Lucas's current GitHub repository created.
- 2018-2026: NEWS records maintained user-visible changes in the modern series.
- 2026: NEWS for Cdecl 18.8 records updated XDG configuration paths.

### Related projects

- The program includes cdecl and c++decl entry points and is historically related to explain, cast, and declare-style links mentioned in the AUTHORS file. Its modern feature set tracks C and C++ language standards rather than depending on a large plugin ecosystem.

### 来源

- <https://api.github.com/repos/paul-j-lucas/cdecl>
- <https://github.com/paul-j-lucas/cdecl>
- <https://github.com/paul-j-lucas/cdecl#readme>
- <https://formulae.brew.sh/api/formula/cdecl.json>
- <https://github.com/paul-j-lucas/cdecl/blob/master/AUTHORS>
- <https://github.com/paul-j-lucas/cdecl/blob/master/NEWS>
- <https://github.com/paul-j-lucas/cdecl/blob/master/share/man/man1/cdecl.1>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.cdeclrc, $XDG_CONFIG_HOME/cdecl/cdeclrc, ~/.config/cdecl/cdeclrc, $XDG_CONFIG_DIRS/*/cdecl/cdeclrc, /etc/xdg/cdecl/cdeclrc
## 其他软件包管理器记录

- Debian apt - cdecl - 2.5-15+b1: normalized package name match | Debian stable package indexes: cdecl from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Turn English phrases to C or C++ declarations
- Nix - cdecl: normalized package name match | nixpkgs package indexes: pkgs/by-name/cd/cdecl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - cdecl - 2.5-13.1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: cdecl from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Turn English phrases to C or C++ declarations
- dnf - cdecl - 18.7.2-2.fc45: normalized package name match | Fedora Rawhide package metadata: cdecl from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Translator for C gibberish | https://github.com/paul-j-lucas/cdecl/
- zypper - cdecl - 18.7.2-1.4: normalized package name match | openSUSE Tumbleweed package metadata: cdecl from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | C/C++ function declaration translator | https://github.com/paul-j-lucas/cdecl/
- MacPorts - cdecl: normalized package name match | MacPorts ports tree: devel/cdecl/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/cdecl.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cdecl.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
