Project

General

Profile

Bug #725

[xsf] Many warnings with GCC 7

Added by John Lindgren over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Minor
Assignee:
-
Category:
plugins/xsf
Target version:
Start date:
June 07, 2017
Due date:
% Done:

100%

Estimated time:
Affects version:

Description

The xsf plugin generates many warnings with GCC 7.1.1, such as:

desmume/MMU.cc: In function ‘void MMU_clearMem()’:
desmume/MMU.cc:310:43: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(ARM9Mem.blank_memory,  0, 0x020000);
                                           ^
In file included from desmume/armcpu.h:26:0,
                 from desmume/cp15.h:25,
                 from desmume/arm_instructions.cc:25:
desmume/arm_instructions.cc: In function ‘u32 OP_SBC_S_LSL_IMM(armcpu_t*)’:
desmume/arm_instructions.cc:1333:46: warning: ‘~’ on an expression of type bool [-Wbool-operation]
      cpu->CPSR.bits.V = SIGNED_UNDERFLOW(v, (!cpu->CPSR.bits.C), tmp) | SIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]);\
desmume/bits.h:38:23: note: in definition of macro ‘BIT31’
 #define BIT31(i)    ((i)>>31)
                       ^
desmume/arm_instructions.cc:1333:25: note: in expansion of macro ‘SIGNED_UNDERFLOW’
      cpu->CPSR.bits.V = SIGNED_UNDERFLOW(v, (!cpu->CPSR.bits.C), tmp) | SIGNED_UNDERFLOW(tmp, shift_op, cpu->R[REG_POS(i,12)]);\
                         ^~~~~~~~~~~~~~~~
desmume/arm_instructions.cc:1343:6: note: in expansion of macro ‘OP_SBCS’
      OP_SBCS(2, 4);
      ^~~~~~~
desmume/arm_instructions.cc:1333:46: note: did you mean to use logical not (‘!’)?
These look like legitimate problems, and I'm not familiar enough with the code to implement a fix. We also have a very old fork of desmume while upstream has moved on (https://github.com/TASVideos/desmume).

Ariadne Conill: Thoughts? Do you have any interest in updating this plugin or at least fixing the warnings?

History

#1 Updated by John Lindgren over 7 years ago

  • Status changed from New to Closed
  • Assignee deleted (Ariadne Conill)
  • Target version set to 3.9
  • % Done changed from 0 to 100

Never mind, I implemented some minimal/hopefully safe fixes.

Also available in: Atom PDF