Apache OpenOffice (AOO) Bugzilla – Issue 22371
osl API requires clients to use illegal pointer conversions
Last modified: 2004-02-12 12:56:45 UTC
There are several osl APIs that relate to symbols within shared libraries and that require symbol addresses to be passed as void*. Frequently these APIs need to be used with function symbols, so clients need to convert parameters or results between void* and function pointers. Such conversions are illegal in C++ (and potentially even in C). Even though compilers can be made to do the required conversion, this forces use of C-Style casts and produces warnings at higher warning levels. There may even exit platforms, where this ceases to work at all. This portability issue should be encapsulated in sal, to shield client code from that problem and allow a global reduction of warnings. All osl functions that work on symbol adresses should provide two signatures, one of which supports function pointers. Suggested header additions: osl/module.h: typedef void (*oslGenericFunction)(void); oslGenericFunction SAL_CALL osl_getFunctionSymbol(oslModule Module, rtl_uString *strSymbolName); sal_Bool SAL_CALL osl_getModuleURLFromFunctionAddress( oslGenericFunction pf, rtl_uString **pustrURL ); osl/module.hxx: oslGenericFunction SAL_CALL osl::Module:: getFunctionSymbol( const ::rtl::OUString& strSymbolName); static sal_Bool SAL_CALL osl::Module:: getUrlFromAddress(oslGenericFunction addr, ::rtl::OUString & libraryUrl); Note: The inconsistency in the spelling of URL/Url was copied from existing APIs.
Hi Gorden, it's your now :-) JB already gave some suggestions on how to resolve this issue (see above). Feel free to ask me in case of questions. Kind Regards, Tino
i22046 depends on this issue
Should use IZ dependency to reflect that
OK, issue accepted and undergoing, new to IZ, forgot to give this message:-).thanks JB and Tino's description.
source code of this bug has been completed and reviewed, Tino will check in the source and care for this.
Now there are some additional functions in osl/module which accept or return a generic function pointer instead of a data pointer, e.g. osl_getFunctionAddress or osl_getModuleURLFromFunctionAddress. Appropriate inline wrapper are available as well.
Set to verified
Verified on head revision.
Marking as resolved again
Marking as verified again
Closing