Closed Bug 224012 Opened 21 years ago Closed 15 years ago

VerReg.c warning: "VR_FILE_SEP" redefined

Categories

(Core :: XPCOM, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: timeless, Assigned: philor)

References

Details

Attachments

(1 file, 2 obsolete files)

/Users/timeless/mozilla/modules/libreg/src/VerReg.c
284:1: warning: "VR_FILE_SEP" redefined
278:1: warning: this is the location of the previous definition
Attached patch fix warning (obsolete) — Splinter Review
Attachment #134368 - Flags: superreview?(dveditz+bmo)
Attachment #134368 - Flags: review?(dveditz+bmo)
Comment on attachment 134368 [details] [diff] [review]
fix warning

r=dveditz
Attachment #134368 - Flags: superreview?(dveditz+bmo)
Attachment #134368 - Flags: review?(dveditz+bmo)
Attachment #134368 - Flags: review+
Attachment #134368 - Flags: superreview?(dbaron)
Doesn't this *change* what VR_FILE_SEP is for XP_MACOSX + XP_UNIX?
no it does not change XP_UNIX, but it does change XP_MACOSX. I think that the
change satisfies the spirit of the code. i can try to have someone confirm that
changing it does not break anything...
I meant when both are defined, and it seems like XP_MACOSX may need "/".
I think this change is bad. I think we want the seperator to be '/' on OS X.

Reasoning:

The seperator is used here:

http://lxr.mozilla.org/seamonkey/source/modules/libreg/src/VerReg.c#287

and that's called through here:
http://lxr.mozilla.org/seamonkey/source/modules/libreg/src/VerReg.c#555
http://lxr.mozilla.org/seamonkey/ident?i=vr_GetPathname

Tracing back we find one of the places the directory string is initialized is here:
http://lxr.mozilla.org/seamonkey/source/modules/libreg/src/reg.c#269

Which calls: FSRefMakePath, which is documented here:

http://developer.apple.com/documentation/Carbon/Reference/File_Manager/file_manager/function_group_8.html

as "returning paths suitable for POSIX-style calls". ie, it'll use '/'

So I think you need to rethink so the seperator on OS X remains '/'
Attachment #134368 - Flags: superreview?(dbaron) → superreview-
Attached patch fix warning but keep behavior (obsolete) — Splinter Review
Attachment #134368 - Attachment is obsolete: true
Attachment #141024 - Flags: review?(lordpixel)
Is XP_UNIX defined for Mac OS X builds?

It might be clearer to write:

#elif defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_MACOS_X)

Just so people less familar with OS X or the vagarities of Mozilla's #defines
realize that we're not taking the XP_MAC branch.
yeah it's defined. standard usage is: #if defined(XP_UNIX) && !defined(XP_MACOSX)
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/modules/plugin/base/src/ns4xPlugin.cpp&rev=1.105&mark=469#445
Status: NEW → ASSIGNED
Apologies for the stream of questions, but is XP_MAC defined on OSX?
If it is you're going to get the wrong answer.

I still think it would be clearer is XP_MACOSX appeared in the if-then-else
explicitly. I'd rather the code said what it does than have to know that XP_MAC
is not defiend (counterintuitive) and XP_UNIX is defined (not immediately obvious).
nope, XP_MAC and XP_MACOSX are exclusive hence things like:
/embedding/browser/webBrowser/nsWebBrowser.cpp, line 70 -- #if (defined(XP_MAC)
|| defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
Component: XPCOM Registry → XPCOM
QA Contact: xpcom
Comment on attachment 141024 [details] [diff] [review]
fix warning but keep behavior

Conveniently enough, in the intervening five years XP_MAC has become undefined, so now you can do a simpler version without it (and r+sr? dveditz, because you're not getting anything out of lordpixel).
Attachment #141024 - Attachment is obsolete: true
Attachment #141024 - Flags: review?(lordpixel)
Whiteboard: [timeless: need new patch]
Surprise!

Not entirely clear what you're proposing. What change do you believe should be made?
You had your chance, in 2004. Too late now.
Time to sweep it out, before the corpse starts to smell (any more).
Assignee: timeless → philringnalda
Attachment #355521 - Flags: superreview?
Attachment #355521 - Flags: review?
Comment on attachment 355521 [details] [diff] [review]
XP_MAC is long dead

Curse you, "failed to match any Bugzilla usernames."
Attachment #355521 - Flags: superreview?(dveditz)
Attachment #355521 - Flags: superreview?
Attachment #355521 - Flags: review?(dveditz)
Attachment #355521 - Flags: review?
Blocks: 281889
Hardware: PowerPC → All
Whiteboard: [timeless: need new patch]
Your patch looks good.
Comment on attachment 355521 [details] [diff] [review]
XP_MAC is long dead

r/sr=dveditz, but isn't libreg dead already?
Attachment #355521 - Flags: superreview?(dveditz)
Attachment #355521 - Flags: superreview+
Attachment #355521 - Flags: review?(dveditz)
Attachment #355521 - Flags: review+
'e's not dead, 'e's just resting.

It's hypothetically used by migration, I think to hypothetically find Suite and 4.x profiles to import, which hypothetically still works even though we've started claiming it's unsupported despite the code still being around.
http://hg.mozilla.org/mozilla-central/rev/151cf0a020b0
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: