Skip to content

easy: fix unused global on non-Windows - #22750

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:unused-global
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:unused-global

Conversation

@vszakats

Copy link
Copy Markdown
Member

Detected by llvm/clang 23.1.0:

lib/easy.c:83:13: warning: variable 'easy_init_flags' set but not used [clang-diagnostic-unused-but-set-global]
   83 | static long easy_init_flags;
      |             ^
lib/easy.c:83:13: warning: variable 'easy_init_flags' set but not used [-Wunused-but-set-global]
   83 | static long easy_init_flags;
      |             ^

Detected by llvm/clang 23.1.0:
```
lib/easy.c:83:13: warning: variable 'easy_init_flags' set but not used [clang-diagnostic-unused-but-set-global]
   83 | static long easy_init_flags;
      |             ^
lib/easy.c:83:13: warning: variable 'easy_init_flags' set but not used [-Wunused-but-set-global]
   83 | static long easy_init_flags;
      |             ^
```

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Pull request overview

Scopes Windows-only initialization state to Windows builds, eliminating Clang’s unused-global warning elsewhere.

Changes:

  • Guards easy_init_flags usage with _WIN32.
  • Explicitly marks flags unused on non-Windows platforms.
  • Resets Windows flags during Windows cleanup.
File summaries
File Description
lib/easy.c Makes initialization-flag storage Windows-specific.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vszakats vszakats closed this in 2a395a0 Aug 30, 2026
@vszakats
vszakats deleted the unused-global branch August 30, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants