Fix error: conversion from ‘int’ to ‘uchar’ {aka ‘unsigned char’} #120879
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#120879
Loading…
Reference in New Issue
No description provided.
Delete Branch "Giang-Chaebol/blender:FixConversionBlfGlyph"
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 pull request fixes the following errors when following this instruction:
Hello, and thanks for looking at this. My compiler is not giving me this same warning, so I am a bit blind here.
This warning is about an assignment to uchar from a function that returns uchar. That function takes one uchar argument and we are giving it the product of multiplying a uchar with a char.
So to my eye your proposed solution of a functional "char" cast, should actually be a functional "uchar" cast? But isn't the real problem that "scale", defined a few lines earlier, should be defined as uchar?
Does the following remove this warning for you?
It still gives me the error, see the video.
Sorry, but I'm not seeing the error in that video. Although you have blf_glyph.cc loaded, the capture is showing terminal messages to do with index_mask.cc
Yes sorry my bad. Hereby I send you the correct one.
@Giang-Chaebol it's strange that your running into these errors as I don't get them with recent Linux/macOS build environments, what compiler version are you using?
In the build output there is the message "unrecognized command line option" this is a hint that there is something wrong with the build as CMake is meant to detect this flag and only pass it in when it's supported (see: C_WARN_NO_STRINGOP_OVERREAD, CXX_WARN_NO_STRINGOP_OVERREAD).
Could you check if creating a new build directory resolves the issue?
I always build from scratch, I even try to build it in a docker image and the same errors still appear.
@Giang-Chaebol building shouldn't even have started since CMake checks GCC is at least 11.0.0, did you modify
CMakeLists.txt
in order to get Blender building?What does
gcc --version
report?(multiverse) giangnguyen@giangnguyen-PC:~$ gcc --version
gcc (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
And no, I don't modify anything.
@Giang-Chaebol I've committed additional checks for C++ version
e5dfc814e9
, can you check that the build now raises an error early on?Ok the error from your
CMakeLists.txt
appeared to stop me from building it. I upgraded myg++
to 11 and rebuilt it. Now it can compile fine without giving me any errors.Btw, your message is confusing:
instead of GCC, it should be G++, otherwise it doesn't make sense.
However, I still think it might be better to fix the line for cleaner code. Explicit type conversion prevents data loss and increases clarity.
GCC is the name of the project,
g++
is the command but this is still typically referred to as the GCC version.Clarified between C/C++ compilers
5f6516a19a
.Closing this PR as the error was caused by an unsupported C++ compiler.
Our CMake compiler checks have been updated so this wont happen again.
Pull request closed