Closed Bug 458491 Opened 16 years ago Closed 10 years ago

[meta] possibly dead code (gcc warnings)

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: guninski, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

Attachments

(2 files)

according to gcc build with -Wall -W there are:
13 unused vars
51 constant expressions

quick glance show they are plausible.

the most drastic is:
1601:../../../dist/include/lcms/lcms.h:1436: warning: comparison of unsigned
expression < 0 is always false

LCMS_INLINE void* _cmsMalloc(size_t size)
{
    if (size > ((size_t) 1024*1024*500)) return NULL;  // Never allow over
500Mb
********    if (size < 0) return NULL;********

probably the fix will be deleting stuff.
You should probably file a bug for each affected file, like I did for bug 440771, so you can CC appropriate developers and attach patches.
Blocks: 458701
Blocks: 458702
Blocks: 458703
Blocks: 458704
Blocks: 458705
Blocks: 458706
Blocks: 458707
Blocks: 458708
Blocks: 458710
Blocks: 458711
Blocks: 458712
Blocks: 458714
the ``unused'' are forked
Blocks: 458719
Blocks: 458720
Blocks: 458721
Blocks: 458722
Blocks: 458724
Blocks: 458725
Blocks: 458726
Blocks: 458728
Blocks: 458729
Blocks: 458730
the forking bugspam of this bug is over.
I don't think that its necessary to create a bug for every single warning that you get.
Better group them together according to the modules (like editor/, widget/ etc)
Also note that mozilla imports the sources of external projects into the source control.
Theora, LittleCMS and others. Would be better to file bugs upstream for those projects.
It seems like lines 1758 through 1775 on attachment one aren't valid, because type.TagPart() returns uint8, and the values of nsXPTType::T_I8 and so on are all less than 255 and greater than or equal to zero. Though if that's the case, I'm not sure why the warning is there at all.
the uint8 warning puzzles me too.
the uint8 warning is real on 64 bit system (and probably at least in one case on 32 bit systems).

the problem isn't the switch(), the problem is POPULATE macro:
http://mxr.mozilla.org/mozilla-central/source/js/src/xpconnect/src/xpcconvert.cpp#1904


1904 #define POPULATE(_mode, _t)                                                  \
1905     PR_BEGIN_MACRO                                                           \
1906         cleanupMode = _mode;                                                 \
1907         if (capacity > ~(size_t)0 / sizeof(_t) ||


capacity is uint32 and ~(size_t)0 is uint64 and sizeof(_t) can't compensate for 32 bits.

this may be a bug of its own on 64 bit systems.
Blocks: buildwarning
Is there anything to do here? This looks like a meta bug now. If bug 458728 is closed, will this one be closed too?
Keywords: meta
(In reply to :aceman from comment #10)
> Is there anything to do here? This looks like a meta bug now. If bug 458728
> is closed, will this one be closed too?

Once we know we have deleted all dead code, bug 458728 will close. This one only needs to close if we have deleted all of the dead code gcc knows about :)
Haven't you mistaken bug 458728 for bug 457262? Or did I?
(In reply to :aceman from comment #12)
> Haven't you mistaken bug 458728 for bug 457262? Or did I? 
Thanks, let me restate.

Once we know we have deleted all dead code, bug 457262 will close. This one only needs to close if we have deleted all of the dead code gcc knows about :)

Is there anything in particular you'd like to act upon related to these bugs?
Maybe drive bug 458728 to closure?:)
My question was if that one is closed, if this one can be closed too, or if this one stays open so some new bugs can be linked to it.
All the bugs blocking this bug have been resolved, and it hasn't been modified since late 2011. I think we can safely close this one.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
Summary: possibly dead code (gcc warnings) → [meta] possibly dead code (gcc warnings)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: