Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

gcc海湾合作委员会

Agent Skill

gcc 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,769

周安装

112

GitHub Stars

80

下载量

869
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gcc(海湾合作委员会)
来源仓库:https://github.com/mohitmishra786/low-level-dev-skills
仓库路径:skills/gcc
安装命令:
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill gcc
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill gcc

简介

gcc 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装并使用该技能。
  • 安装前需确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • 建议结合原始 README 进一步核验具体用法和功能边界。

SKILL.md

GCC

Purpose

Guide agents through GCC invocation: flag selection, build modes, warning triage, PGO, LTO, and common error patterns. Assume the project uses GNU Make, CMake, or a shell script.

Triggers

  • "What flags should I use for a release build?"
  • "GCC is giving me a warning/error I don't understand"
  • "How do I enable LTO / PGO with GCC?"
  • "How do I compile with -fsanitize?"
  • "My binary is too large / too slow"
  • Undefined reference errors, ABI mismatch, missing symbols

Workflow

1. Choose a build mode

GoalRecommended flags
Debug-g -O0 -Wall -Wextra
Debug + debuggable optimisation-g -Og -Wall -Wextra
Release-O2 -DNDEBUG -Wall
Release (max perf, native only)-O3 -march=native -DNDEBUG
Release (min size)-Os -DNDEBUG
Sanitizer (dev)-g -O1 -fsanitize=address,undefined

Always pass -std=c11 / -std=c++17 (or the required standard) explicitly. Never rely on the implicit default.

2. Warning discipline

Start with -Wall -Wextra. For stricter standards compliance add -Wpedantic. To treat all warnings as errors in CI: -Werror.

Suppress a specific warning only in a narrow scope:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// ...
#pragma GCC diagnostic pop

Do not pass -w (silences everything) except as a last resort for third-party headers.

3. Debug information

  • -g — DWARF debug info, default level 2
  • -g3 — includes macro definitions (useful with GDB macro expand)
  • -ggdb — DWARF extensions optimal for GDB
  • -gsplit-dwarf — splits .dwo files; reduces link time, needed for debuginfod

Pair -g with -Og (not -O0) when you need readable optimised code in GDB.

4. Optimisation decision tree

Need max throughput on a fixed machine?
  yes -> -O3 -march=native -flto
  no  -> profiling available?
           yes -> -O2 -fprofile-use
           no  -> -O2
Size-constrained (embedded, shared lib)?
  yes -> -Os  (or -Oz with clang)

-O3 vs -O2: -O3 adds aggressive loop transformations (-funswitch-loops, -fpeel-loops, -floop-interchange) and more aggressive inlining. Use -O3 only after benchmarking; it occasionally regresses due to i-cache pressure.

-Ofast: enables -ffast-math which breaks IEEE 754 semantics (NaN handling, associativity). Avoid unless the numerical domain explicitly permits it.

5. Link-time optimisation (LTO)

# Compile
gcc -O2 -flto -c foo.c -o foo.o
gcc -O2 -flto -c bar.c -o bar.o
# Link (must pass -flto again)
gcc -O2 -flto foo.o bar.o -o prog

Use gcc-ar / gcc-ranlib instead of ar / ranlib when archiving LTO objects into static libs.

For parallel LTO: -flto=auto (uses make-style jobserver) or -flto=N.

See references/flags.md for full flag reference. See skills/binaries/linkers-lto for linker-level LTO configuration.

6. Profile-guided optimisation (PGO)

# Step 1: instrument
gcc -O2 -fprofile-generate prog.c -o prog_inst
# Step 2: run with representative workload
./prog_inst < workload.input
# Step 3: optimise with profile
gcc -O2 -fprofile-use -fprofile-correction prog.c -o prog

-fprofile-correction handles profile data inconsistencies from multi-threaded runs.

7. Preprocessor and standards

  • Inspect macro expansion: gcc -E file.c | less
  • Dump predefined macros: gcc -dM -E - < /dev/null
  • Force strict standard: -std=c11 -pedantic-errors
  • Disable GNU extensions: -std=c11 (not -std=gnu11)

8. Common error triage

SymptomLikely causeFix
undefined reference to 'foo'Missing -lfoo or wrong link orderAdd -lfoo; move -l flags after object files
multiple definition of 'x'Variable defined (not just declared) in a headerAdd extern in header, define in one .c
implicit declaration of functionMissing #includeAdd the header
warning: incompatible pointer typesWrong cast or missing prototypeFix the type; check headers
ABI errors with C++Mixed -std= or different libstdc++Unify -std= across all TUs
relocation truncatedOverflow on a 32-bit relative relocationUse -mcmodel=large or restructure code

For sanitizer reports, use skills/runtimes/sanitizers.

9. Useful one-liners

# Show all flags enabled at -O2
gcc -Q --help=optimizers -O2 | grep enabled

# Preprocess only (check includes/macros)
gcc -E -dD src.c -o src.i

# Assembly output (Intel syntax)
gcc -S -masm=intel -O2 foo.c -o foo.s

# Show include search path
gcc -v -E - < /dev/null 2>&1 | grep -A20 '#include <...>'

# Check if a flag is supported
gcc -Q --help=target | grep march

For a complete flag cheatsheet, see references/flags.md. For common error patterns and examples, see references/examples.md.

Related skills

  • Use skills/runtimes/sanitizers to add -fsanitize=* builds
  • Use skills/compilers/clang when switching to clang/LLVM
  • Use skills/binaries/linkers-lto for advanced LTO linker flags
  • Use skills/debuggers/gdb for debugging GCC-built binaries

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.13%
按下载量换算305

Claude

30.89%
按下载量换算268

Cursor

19.71%
按下载量换算171

Gemini CLI

9.62%
按下载量换算84

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill gcc 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills