Project

General

Profile

Bug #1413

Various Mac clang warnings are likely bugs

Added by Jim Phillips over 2 years ago. Updated over 2 years ago.

Status:
Merged
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
02/13/2017
Due date:
% Done:

0%


Description

The pup_xlater.C error turns cvt_bool() into an infinite loop.

The machine.c error will make LrtsAbort do nothing if Cmi_truecrash is true - it should at least abort.

ckarrayreductionmgr.C:132:19: warning: comparison of constant -1 with expression of type 'unsigned short' is
      always true [-Wtautological-constant-out-of-range-compare]
                        if (m->userFlag!=-1)
                            ~~~~~~~~~~~^ ~~

pup_xlater.C:138:25: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
        for (i=nElem-1;i>=0;i--)
                       ~^ ~

machine.c:549:5: warning: indirection of non-volatile null pointer will be deleted, not trap
      [-Wnull-dereference]
    *(int *)NULL = 0; /*Write to null, causing bus error*/
    ^~~~~~~~~~~~

History

#1 Updated by Sam White over 2 years ago

  • Subject changed from various Mac clang warnings are likley bugs to Various Mac clang warnings are likely bugs

This commit will remove ckarrayreductionmgr completely, so that warning will go away: https://charm.cs.illinois.edu/gerrit/#/c/2216/

The pup_xlater one should be fixed.

The machine.c one is more interesting. It appears from the git history to have been added so that when debugging Charm you get a true crash with the full stacktrace rather than a clean exit with an abort message when running with ++debug and/or +truecrash. That seems useful, and that code will only execute if Cmi_truecrash is true.

#2 Updated by Phil Miller over 2 years ago

For the machine.c case, it would be easy enough to add the suggested volatile to it. That is precisely an intended use.

#3 Updated by Sam White over 2 years ago

  • Status changed from New to Implemented
  • Assignee set to Sam White

#4 Updated by Phil Miller over 2 years ago

  • translation missing: en.field_closed_date set to 2017-02-15 10:40:03.269341
  • Status changed from Implemented to Merged
  • Target version set to 6.8.0

Also available in: Atom PDF