Skip to content

warning: ISO C forbids conversion of object pointer to function pointer type  #226

@uli42

Description

@uli42

In nx-X11/lib/X11 we get several of these warnings. And it is unclear how to fix them in clean manner. Upstream has exactly the same code here. So either they are not using -Wpedantic or they don't care.

Here's a link with a possible solution but this way out code will differ from upstream: http://stackoverflow.com/questions/36384195/how-to-correctly-assign-a-pointer-returned-by-dlsym-into-a-variable-of-function

CrGlCur.c: In function ‘_XTryShapeCursor’:
CrGlCur.c:158:19: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
      staticFunc = (type) fetch_symbol (_XcursorModule, "_" name); \
                   ^
CrGlCur.c:175:5: note: in expansion of macro ‘GetFunc’
     GetFunc (TryShapeCursorFunc, "XcursorTryShapeCursor", func);
     ^
CrGlCur.c: In function ‘_XNoticeCreateBitmap’:
CrGlCur.c:158:19: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
      staticFunc = (type) fetch_symbol (_XcursorModule, "_" name); \
                   ^
CrGlCur.c:190:5: note: in expansion of macro ‘GetFunc’
     GetFunc (NoticeCreateBitmapFunc, "XcursorNoticeCreateBitmap", func);
     ^
CrGlCur.c: In function ‘_XNoticePutBitmap’:
CrGlCur.c:158:19: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
      staticFunc = (type) fetch_symbol (_XcursorModule, "_" name); \
                   ^
CrGlCur.c:202:5: note: in expansion of macro ‘GetFunc’
     GetFunc (NoticePutBitmapFunc, "XcursorNoticePutBitmap", func);
     ^
CrGlCur.c: In function ‘_XTryShapeBitmapCursor’:
CrGlCur.c:158:19: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
      staticFunc = (type) fetch_symbol (_XcursorModule, "_" name); \
                   ^
CrGlCur.c:218:5: note: in expansion of macro ‘GetFunc’
     GetFunc (TryShapeBitmapCursorFunc, "XcursorTryShapeBitmapCursor", func);
     ^

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions