This one walks you through GCC flag selection for different build modes: debug with `-g -Og`, release with `-O2` or `-O3 -march=native`, size-optimized with `-Os`, and sanitizer builds. It covers LTO and PGO workflows step by step, warning flag discipline with `-Wall -Wextra`, and a triage table for common errors like undefined references and ABI mismatches. The optimization decision tree is practical, especially the note that `-O3` can regress performance due to instruction cache pressure. If you've ever second-guessed whether to enable `-flto` or wondered why `-Ofast` broke your floating point math, this gives you the exact invocations and explains the tradeoffs without the usual compiler flag folklore.

skills.sh installs
741
GitHub stars
279
last updated
Aug 21, 2026

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill gcc --agent claude-code

Installs into .claude/skills of the current project.

Files

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.

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
DevOps & CI/CD, Release Management, Debugging
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54
1joellewis avatartrade-executionjoellewis/finance_skillsGuide the design, evaluation, and monitoring of trade execution quality and best execution practices. Use when assessing best execution obligations under FINRA 739skills.sh installs
2voltagent avatarvoltagent-best-practicesvoltagent/skillsVoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.739skills.sh installs
3jezweb avatarreact-native-expojezweb/claude-skillsBuild React Native 0.76+ apps with Expo SDK 52-54. Covers mandatory New Architecture (0.82+/SDK 55+), React 19 changes, SDK 54 breaking changes (expo-av, expo-f738skills.sh installs
4new-silvermoon avatarandroid-gradle-logicnew-silvermoon/awesome-android-agent-skillsExpert guidance on setting up scalable Gradle build logic using Convention Plugins and Version Catalogs.738skills.sh installs
5zxkane avataraws-serverless-edazxkane/aws-skillsAWS serverless and event-driven architecture expert based on Well-Architected Framework. Use when building serverless APIs, Lambda functions, REST APIs, microse738skills.sh installs
6ruvnet avataradr-indexruvnet/rufloBuild or rebuild the ADR index + dependency graph by running scripts/import.mjs (handles v3-style and plugin-style ADR formats; one Bash call vs hundreds of MCP737skills.sh installs