blender-2.69/source/blender/freestyle/intern/geometry/VecMat.h:707]: (error) Reference to auto variable returned. #38887

Closed
opened 2014-02-28 10:05:53 +01:00 by David Binderman · 14 comments

Source code is

  inline Matrix<T, M, N>& transpose() const
  {
      Matrix<T, N, M> res;
      for (unsigned int i = 0; i < M; i++) {
          for (unsigned int j = 0; j < N; j++)
              res(j, i) = this->_coord[i * N + j];
      }
      return res;

Suggest code rework.

Source code is ``` inline Matrix<T, M, N>& transpose() const { Matrix<T, N, M> res; for (unsigned int i = 0; i < M; i++) { for (unsigned int j = 0; j < N; j++) res(j, i) = this->_coord[i * N + j]; } return res; ``` Suggest code rework.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @dcb

Added subscriber: @dcb

Added subscribers: @kjym3, @mont29

Added subscribers: @kjym3, @mont29

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Could you give some more info? What program gives this error?

Could you give some more info? What program gives this error?

The quoted code is the definition of Matrix.transpose() which is part of the Freestyle code base.
Apparently this method is never used in the Freestyle implementation at the moment.
If the reported error breaks compilation, I would omit the method definition by an #if 0 block for now.

The quoted code is the definition of Matrix.transpose() which is part of the Freestyle code base. Apparently this method is never used in the Freestyle implementation at the moment. If the reported error breaks compilation, I would omit the method definition by an #if 0 block for now.

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Tamito Kajiyama was assigned by Thomas Dinges 2014-02-28 11:36:48 +01:00

Could you give some more info? What program gives this error?

cppcheck, a static analysis available from sourceforge.

>Could you give some more info? What program gives this error? cppcheck, a static analysis available from sourceforge.

Added subscriber: @brecht

Added subscriber: @brecht

This code is clearly wrong. The last line should be replaced by:

*this = res;

return *this;
This code is clearly wrong. The last line should be replaced by: *this = res; ``` return *this;

This issue was referenced by blender/blender-addons-contrib@da5e6b98c9

This issue was referenced by blender/blender-addons-contrib@da5e6b98c9991c7f113e97bbf856e7bc0161bcc0

This issue was referenced by da5e6b98c9

This issue was referenced by da5e6b98c9991c7f113e97bbf856e7bc0161bcc0

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit da5e6b98c9.

Closed by commit da5e6b98c9.
Sign in to join this conversation.
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
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#38887
No description provided.