Last Comment Bug 341287 - LOG_SCOPE macro in ImageLogging.h doesn't do what it looks like
: LOG_SCOPE macro in ImageLogging.h doesn't do what it looks like
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: 1.8 Branch
: All All
: -- normal (vote)
: mozilla13
Assigned To: Jeff Muizelaar [:jrmuizel]
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-12 13:23 PDT by David Baron :dbaron: ⌚️UTC-10 (vacation, returning December 19)
Modified: 2012-02-02 08:08 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
expand __LINE__ before pasting (1.62 KB, patch)
2012-01-27 13:22 PST, Jeff Muizelaar [:jrmuizel]
justin.lebar+bug: review+
Details | Diff | Splinter Review

Description David Baron :dbaron: ⌚️UTC-10 (vacation, returning December 19) 2006-06-12 13:23:49 PDT
the LOG_SCOPE and LOG_SCOPE_WITH_PARAM macros don't actually use __LINE__ the way they look like they do; thus builds with -Wshadow produce warnings:

/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:409: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:266: warning: shadowed declaration is here
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:480: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:266: warning: shadowed declaration is here


or

/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:809: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:804: warning: shadowed declaration is here
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:825: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:809: warning: shadowed declaration is here

and would presumably produce an error if two were used in the same scope.  If that's not actually ever needed, the __LINE__ stuff should be removed; otherwise it should use the nested macros that are needed to make this work, such as those in AUTO_MARK_JSVAL and AUTO_MARK_JSVAL_HELPER* in:
http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/src/xpcprivate.h#3454
Comment 1 Jeff Muizelaar [:jrmuizel] 2012-01-27 13:22:45 PST
Created attachment 592248 [details] [diff] [review]
expand __LINE__ before pasting
Comment 2 Justin Lebar (not reading bugmail) 2012-01-27 13:34:54 PST
Comment on attachment 592248 [details] [diff] [review]
expand __LINE__ before pasting

r=me, but please undef the new APPEND_LINE_NUMBER* macros.
Comment 3 Jeff Muizelaar [:jrmuizel] 2012-02-01 08:02:52 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/006eebde1259
Comment 4 Ed Morley [:emorley] 2012-02-02 08:08:16 PST
https://hg.mozilla.org/mozilla-central/rev/006eebde1259

Note You need to log in before you can comment on or make changes to this bug.