Closed Bug 832548 Opened 12 years ago Closed 4 years ago

gfxPlatformMac.cpp:483:14: warning: 'FSpMakeFSRef' is deprecated [-Wdeprecated-declarations]

Categories

(Core :: Graphics, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dholbert, Unassigned)

References

Details

I'd like to mark /gfx/thebes as FAIL_ON_WARNINGS, but we currently have a Mac-only build warning (treated as an error if I add FAIL_ON_WARNINGS) for using a deprecated API in gfxPlatformMac.cpp: { /usr/local/bin/ccache /builds/slave/try-osx64/build/clang/bin/clang++ -arch i386 -o gfxMacPlatformFontList.o -c -fvisibility=hidden -DGRAPHITE2_STATIC -DIMPL_THEBES -DWOFF_MOZILLA_CLIENT -DHB_DONT_DEFINE_STDINT -DMOZ_OTS_REPORT_ERRORS -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -DEXCLUDE_SKIA_DEPENDENCIES -DOS_POSIX=1 -DOS_MACOSX=1 -I/builds/slave/try-osx64/build/content/base/public -I/builds/slave/try-osx64/build/content/xml/document/src -I/builds/slave/try-osx64/build/ipc/chromium/src -I/builds/slave/try-osx64/build/ipc/glue -I../../ipc/ipdl/_ipdlheaders -I/builds/slave/try-osx64/build/gfx/thebes -I. -I../../dist/include -I/builds/slave/try-osx64/build/obj-firefox/i386/dist/include/nspr -I/builds/slave/try-osx64/build/obj-firefox/i386/dist/include/nss -fPIC -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -isysroot /Developer/SDKs/MacOSX10.6.sdk -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -DNO_X11 -pipe -DNDEBUG -DTRIMMED -g -O3 -fno-omit-frame-pointer -Werror -Wno-error=uninitialized -I/builds/slave/try-osx64/build/obj-firefox/i386/dist/include/cairo -DNO_X11 -Qunused-arguments -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/gfxMacPlatformFontList.o.pp -fobjc-exceptions /builds/slave/try-osx64/build/gfx/thebes/gfxMacPlatformFontList.mm ../../../../gfx/thebes/gfxPlatformMac.cpp:483:14: error: 'FSpMakeFSRef' is deprecated [-Werror,-Wdeprecated-declarations] if (!FSpMakeFSRef(&location->u.fileLoc.spec, &fsRef)) { ^ /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:7501:15: note: 'FSpMakeFSRef' declared here extern OSErr FSpMakeFSRef(const FSSpec *source, FSRef *newRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; } https://tbpl.mozilla.org/php/getParsedLog.php?id=18941196&tree=Try Looks like the call to this function (FSpMakeFSRef) was added in bug 16769.
FWIW, a quick google search turns up: https://developer.apple.com/library/mac/documentation/Carbon/reference/File_Manager/DeprecationAppendix/AppendixADeprecatedAPI.html ...which says: > FSpMakeFSRef > Creates an FSRef for a file or directory, given an FSSpec. > (Deprecated in OS X v10.5. There is no replacement function.) :-/
OS: Linux → Mac OS X
Hardware: x86_64 → All
Can't you just turn off the deprecation warnings on the Mac in gfx/thebes? :-) > There is no replacement function. This probably means it'll be some work to find a way not to use FSpMakeFSRef. > Deprecated in OS X v10.5 And this probably means Apple isn't really serious about getting rid of it (since it's still present in 10.8).
We could turn it off... or, perhaps better: we can could globally make -Wdeprecated-declarations non-fatal, for warnings-as-errors directories (like we already do for the maybe-uninitialized warnings, which have lots of false positives). So then, when Apple (or whoever) deprecates a function, we'll get a warning about it but it won't break our --enable-warnings-as-errors builds (e.g. TBPL).
The code that uses FSpMakeFSRef is part of our ColorSync support, and the relevant function that's (potentially) giving us an FSSpec is itself deprecated: https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/ColorSync_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000259-Reference-DontLinkElementID_3 So the way forward here, I think, must be to update our ColorSync code to use more modern APIs; then the need for FSpMakeFSRef will disappear.
Component: Graphics: Text → Graphics
(In reply to Daniel Holbert [:dholbert] from comment #3) > or, perhaps better: we can could globally make -Wdeprecated-declarations non-fatal FWIW, I filed bug 833405 on this. Leaving this bug here to cover Comment 4 etc. Carry on. :)

gfxPlatformMac.cpp no longer uses FSpMakeFSRef.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.