WIP: MSVC: lower C4457 warning level from 4 to 3 #105608
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105608
Loading…
Reference in New Issue
No description provided.
Delete Branch "mano-wii/blender:w34457"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit lowers the warning level for C44571, which occurs when a
local variable hides a function parameter with the same name.
The corresponding diagnostic options for GCC and Clang is
-Wshadow
,which is curretly enabled for Blender.
By lowering the warning level for C4457, we align the warnings with
other compilers and avoid unnecessary noise.
Note that in MSVC, the warning only checks the name, whereas the
corresponding one in other compilers apparently checks the
[name + type] match. Then some warnings popped up and the code needed
to be edited.
Little weirded out by some of the actual code changes fixing the shadowed variables, we're doing this to get close to the GCC/Clang set of warnings, and we end up fixing a bunch of stuff they clearly let slip. The windows specific code files , fair enough that's to be expected but why isn't gcc warning on any of the blenkernel changes?
I'm gonna need to take a closer look there, hope you're not in a rush with this.
I also find it strange.
I'll do some tests with GCC to try to understand.
It is strange for example that in GCC
const IndexRange range
is different fromIndexRange range
.CTRL-F
shad
and spamming the 'show addition lines of code for context' arrow reveals 3 occurrences ofshadow
.One in
macros.cmake
.Two in
CMakeLists.txt
All the source files this pull changes end in
.cc
or.cpp
Perhaps adding
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_SHADOW -Wshadow)
(by someone in a different pull request) would be prudent given the codebase's recent language shifting to C++.Thanks for the info @EAW !
The code in this PR proposed to add the corresponding flag in MSVC through:
and
but at the time I didn't notice that the flag was only set for C in GNUCC (and not C++).
I also noticed now that the
Clang
compiler doesn't even have the-Wshadow
flag set!So this PR makes MSVC more restrictive, and doesn't match current GCC and Clang flags.
The ideal seems to be, for now, to add the flag only for C.
MSVC: lower C4457 warning level from 4 to 3to WIP: MSVC: lower C4457 warning level from 4 to 3Checkout
From your project repository, check out a new branch and test the changes.