Open Bug 187528 (buildwarning) Opened 22 years ago Updated 2 years ago

[META] Fix compiler 'Build Warnings'

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: mozilla-bugs, Unassigned)

References

(Depends on 30 open bugs)

Details

(Keywords: meta)

There were some duplicated efforts (see bug 179775) with different people creating conflicting patches aiming at reducing the number of warning in Mozilla, so a general anti-warning tracking bug might be useful. Right now brad TBox lists 1269 warning. If we count duplicates (a header file warning replicated for every C/C++ file that include the header) only once, there are about 688 warnings. The current distribution by "kind" is roughly following: 184 Unused variable `...' 125 `...' might be used uninitialized in this function 62 `...' defined but not used 58 Choosing `...' over `...' For conversion from `...' to `...' Because conversion sequence for the argument is better 54 Comparison between signed and unsigned 44 ...was hidden by `...' 32 ANSI C forbids braced-groups within expressions 14 Return of negative value `...' to `...' Negative integer implicitly converted to unsigned type 10 Multi-character character constant 8 Value computed is not used 8 Suggest parentheses around assignment used as truth value 8 `...' is usually a function 6 ANSI does not permit the keyword `...' 5 Will be re-ordered to match declaration order 5 Using synthesized `...' for copy assignment 5 Missing initializer (near initialization for `...') 5 Member initializers for `...' 5 Enumeration value `...' not handled in switch 5 Converting NULL to non-pointer type 5 Assignment of negative value `...' to `...' Negative integer implicitly converted to unsigned type 5 And `...' 4 `...' has virtual functions but non-virtual destructor 3 Assignment to `...' from `...' 2 `...' within comment 2 Where cfront would use `...' 2 Left shift count >= width of type 2 Label `...' defined but not used 2 Converting of negative value `...' to `...' Negative integer implicitly converted to unsigned type 1 ...was hidden by `...' ...was hidden by `...' 1 String constant runs past end of line 1 Precision used with `...' format 1 Passing arg 1 of `...' discards qualifiers from pointer target type 1 Negative integer implicitly converted to unsigned type 1 Long unsigned int format, PRUint32 arg (arg 3) 1 Initialization to `...' from `...' 1 Initialization of negative value `...' to `...' Negative integer implicitly converted to unsigned type 1 Ignoring pragma: 1 `...' declared `...' but never defined 1 Decimal integer constant is so large that it is unsigned 1 Control reaches end of non-void function `...' 1 Control reaches end of non-void function 1 Char format, void arg (arg 2) 1 Argument `...' might be clobbered by `...' or `...' 1 ANSI C does not support the `...' length modifier 1 ANSI C does not allow extra `...' outside of a function 1 Aggregate has a partly bracketed initializer P.S. To simplify things, for those classes of warnings that have their own tracking bugs (such as bug 59652 for "uninitialized" warnings and 179028 for "hides" warnings), I only list the tracking bug as a dependency (see the dependency tree if you want the complete list).
Depends on: 187530
*** Bug 228464 has been marked as a duplicate of this bug. ***
No longer depends on: 211231
No longer depends on: 114937
Severity: normal → trivial
Depends on: 90906, 114937, 211231, 217089
Summary: Get rid of compilation warnings in Mozilla → [META] Fix compiler 'Build Warnings'
Depends on: 205358
No longer depends on: 189712
Depends on: 219982
Depends on: 221128
Depends on: 214199
No longer depends on: 211231
No longer depends on: 114937
Depends on: 82151
Depends on: 228780
No longer depends on: 228780
No longer depends on: 90906
No longer depends on: 219982, 221128
No longer depends on: 214199
Blocks: 187015
No longer depends on: 187015
Depends on: 132141
No longer depends on: 132141
Depends on: 194240
No longer depends on: 195731
Depends on: 49640, 49641
Depends on: 229182
Depends on: 229456
Depends on: 229540
Depends on: 229631
Depends on: 229730
Depends on: 229874
Depends on: 229866
Depends on: 229897
Depends on: 229969
Depends on: 230001
Depends on: 230030
Depends on: 230397
No longer depends on: 230397
Depends on: 231716
No longer depends on: 230001
Depends on: 287540
Depends on: 300068
Depends on: 305715
No longer depends on: 138188
Depends on: 468781
Depends on: 508531
Depends on: 499995
Back in 2003 it was written: > Right now brad TBox lists 1269 warning. If we count duplicates (a header file > warning replicated for every C/C++ file that include the header) only once, > there are about 688 warnings. The current distribution by "kind" is roughly > following: After fixing about 100 warnings on my own, I was guided to this bug entry. Today there are 1676 on my own compilation of TB3 using comm-central under linux, and unique warnings are 847. There were about 50-60 warnings of the nature as follows. These are newcomers which were not in the list above. $MOZSRC/mozilla/editor/libeditor/html/nsHTMLEditor.cpp:5878:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98 $MOZSRC/mozilla/editor/libeditor/html/nsHTMLEditor.cpp:5879:32: warning: invoking macro NS_ENSURE_TRUE argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98 These have been fixed and be posted to either Bug 609210 or by creating additional bug entry. (I added 609210 in the Depends list.)
Depends on: 609210
Depends on: 665359
Depends on: 665387
Depends on: 665388
Depends on: 665389
Depends on: 665390
Depends on: 665391
Depends on: 659234
Depends on: 665532
Depends on: 665534
Depends on: 665541
Depends on: 665546
Depends on: 665549
Depends on: 665582
Depends on: 665595
Depends on: 665610
Depends on: 665622
Depends on: 665686
Depends on: 665723
Depends on: 458491
Depends on: 513503
Depends on: 604850
Apologies for the bugspam to all the newly added dependant bugs, but I feel that the current level of build warnings (eg 3100+ lines on win debug m-c tip, let alone other platforms) is beyond belief, so am starting on a crusade to eliminate them. Not only do the sheer number of existing warnings make it hard for contributors to work out if a patch has added more, but a proportion of them are potentially hiding real bugs (eg bug 659234). Once the count is down to a more sensible number, I'm hoping that bugs like bug 187015, bug 604850 or bug 513503 will be able to keep them more under control - and mean that people are no longer able to unknowingly add a bunch of warnings with each commit, instead having to fix them as they go.
Alias: buildwarning
Depends on: 662258
Depends on: 669438
In lieu of an automatic build warnings count on tinderbox/TBPL (a la bug 187015); for now I'm manually downloading build logs from various platforms (from try to ensure they get a clobber) and running through a script (based on one sent to me by Chiaki Ishikawa) to scan/summarise the warnings. The warning breakdown counts in the script are still a WIP (the compilers on each platform seem to like outputting the warnings in slightly different formats, so I'll need to work out the least false-positive regex), so for now, here's the summary. First figure is total build warning count, with the unique line count in parentheses. linux-debug: 1106 (700) linux-opt: 2785 (1023) linux64-debug: 1228 (785) linux64-opt: 3027 (1151) osx-debug: 647 (540) osx64-debug: 587 (483) osx64-opt: 2462 (1482) win-debug: 3149 (1660) win-opt: 3312 (1752) [Taken from a try job based on m-c 72331:821b5076d2c0 ~2011-07-05] I'll update this every now and again, to show the progress made by this meta.
Depends on: 586113
Depends on: 669727
Depends on: 670025
Depends on: 670111
Depends on: 669522
Depends on: 670338
Depends on: 554348
Depends on: 350380
Depends on: 440619
Depends on: 265368
Depends on: 488993
Depends on: 505181
Depends on: 431354
Depends on: 413226
Depends on: 297146
Depends on: 549766
Depends on: 301775
Depends on: 535861
Depends on: 263952
Depends on: 556886
Depends on: 331299
Depends on: 564324
Depends on: 219688
Depends on: 545972
Depends on: 343456
Depends on: 486774
Depends on: 670461
Depends on: 631155
Depends on: 670794
Depends on: 671341
Depends on: 672444
Depends on: 90906
Depends on: 228780
Depends on: 677993
Depends on: 678256
Depends on: 678768
Depends on: 678845
Depends on: 678573
Depends on: 679832
Depends on: 682139
Depends on: 682946
Depends on: 683729
Depends on: 677952
Depends on: 683946
Depends on: 683998
Depends on: 685234
Depends on: 686257
Depends on: 679091
Depends on: 687070
Depends on: 687342
Depends on: 687121
Depends on: 687166
Depends on: 686601
Depends on: 687389
Depends on: 458726
Depends on: 458728
Depends on: 689195
Depends on: 689204
Depends on: 689367
Depends on: 691041
Depends on: 691959
Depends on: 693155
Depends on: 697490
Depends on: 697496
Depends on: 698933
Depends on: 131390
Depends on: 699228
Depends on: 699731
Depends on: 700712
Depends on: 700992
Depends on: 703178
Depends on: 703411
Depends on: 708430
Depends on: 709603
Depends on: 711799
Depends on: 711908
Depends on: 711727
Depends on: 713632
Depends on: 714258
Depends on: 716702
Depends on: 717004
Depends on: 717010
Depends on: 717015
Depends on: 717025
Depends on: 717034
Depends on: 716904
Depends on: 719698
Depends on: 720804
Depends on: 720815
Depends on: 721502
Depends on: 721804
Depends on: 722046
Depends on: 722424
Depends on: 617819
Depends on: 723754
Depends on: 723809
Depends on: 726246
Depends on: 726416
Depends on: 726417
Depends on: 726961
Depends on: 726964
Depends on: 726968
Depends on: 727163
Depends on: 727686
Depends on: 727156
Depends on: 727212
Depends on: 727970
Depends on: 728423
Depends on: 728462
Depends on: 729781
Depends on: 730074
Depends on: 731393
Depends on: 732877
Depends on: 733598
Depends on: 734306
Depends on: 736541
Depends on: 716278, 733448
Depends on: 737667
Depends on: 737754
Depends on: 739632
Depends on: 739635
Depends on: 739958
Depends on: 739962
Depends on: 740122
Depends on: 740515
Depends on: 741223
Depends on: 742438
Depends on: 742565
Depends on: 742788
Depends on: 743404
Depends on: 743573
Depends on: 743783
Depends on: 743785
Depends on: 744464
Depends on: 745266
Depends on: 745272
Depends on: 745287
Depends on: 745291
Depends on: 745296
Depends on: 745568
Depends on: 745991
Depends on: 729759
Depends on: 746646
Depends on: 747469
Depends on: 749229
Depends on: 749774
Depends on: 750356
Depends on: 750370
Depends on: 751314
Depends on: 754488
Depends on: 754643
Depends on: 755048
Depends on: 756397
Depends on: 756523
Depends on: 757177
Depends on: 757644
Depends on: 757949
Depends on: 757960
Depends on: 758735
Depends on: 759535
Depends on: 762182
Depends on: 763451
Depends on: 763580
Depends on: 758992
Depends on: 764367
Depends on: 764616
Depends on: 765041
Depends on: 765799
Depends on: 766666
Depends on: 768924
Depends on: 769377
Depends on: 769437
Depends on: 770268
Depends on: 770287
Depends on: 770299
Depends on: 771638
Depends on: 771819
Depends on: 773626
Depends on: 759434
Depends on: 774066
Depends on: 774071
Depends on: 774077
Depends on: 774344
Depends on: 776300
Depends on: 776879
Depends on: 778980
Depends on: 780680
Depends on: 780728
Depends on: 780965
Depends on: 781058
Depends on: 783351
Depends on: 783840
Depends on: 688055
Depends on: 785422
Depends on: 786031
Depends on: 786372
Depends on: 786375
Depends on: 787040
Depends on: 787523
Depends on: 755031
Depends on: 787971
Depends on: 788729
Depends on: 788792
Depends on: 790043
Depends on: 791138
Depends on: 791565
Depends on: 791566
Depends on: 791801
Depends on: 792090
Depends on: 792634
Depends on: 793498
Depends on: 795433
Depends on: 795655
Depends on: 795726
Depends on: 797111
Depends on: 797117
Depends on: 796085
Depends on: 797666
Depends on: 797893
Depends on: 798828
Depends on: 798954
Depends on: 697810
Depends on: 800535
Depends on: 799407
Depends on: 801210
Depends on: 801212
Depends on: 802458
Depends on: 802484
Depends on: 803236
Depends on: 803641
Depends on: 803695
Depends on: 805456
Depends on: 805470
Depends on: 805527
Depends on: 805552
Depends on: 805555
Depends on: 805606
Depends on: 805883
Depends on: 806442
Depends on: 806578
Depends on: 808036
Depends on: 808146
Depends on: 808175
Depends on: 810668
Depends on: 811057
Depends on: 811448
Depends on: 812278
Depends on: 812275
Depends on: 813830
Depends on: 814671
Depends on: 815056
Depends on: 815058
Depends on: 815065
Depends on: 815367
Depends on: 815450
Depends on: 816885
Depends on: 816888
Depends on: 817176
Depends on: 817734
Depends on: 817404
Depends on: 817913
Depends on: 818611
Depends on: 818629
Depends on: 818817
Depends on: 820791
Depends on: 820864
Depends on: 821392
Depends on: 821528
Depends on: 821843
Depends on: 821396
Depends on: 822804
Depends on: 823187
Depends on: 824140
Depends on: 824397
Depends on: 824648
Depends on: 824829
Depends on: 824840
Depends on: 824817
Depends on: 824879
Depends on: 824885
Depends on: 824883
Depends on: 824886
Depends on: 824891
Depends on: 825079
Depends on: 825105
Depends on: 825107
Depends on: 825467