This is an archive of the discontinued LLVM Phabricator instance.

Avoid gcc warning about casting ptr-to-object to ptr-to-fun
AcceptedPublic

Authored by dougk on May 9 2016, 1:29 PM.

Details

Reviewers
zaks.anna
Summary

Use the workaround provided in the dlsym() man page.

Diff Detail

Event Timeline

dougk updated this revision to Diff 56618.May 9 2016, 1:29 PM
dougk retitled this revision from to Avoid gcc warning about casting ptr-to-object to ptr-to-fun.
dougk updated this object.
dougk added a reviewer: zaks.anna.
dougk added a subscriber: llvm-commits.
jroelofs added inline comments.
lib/stats/stats_client.cc
33

IIUC, this should be written as:

void (*LookupSymbolFromMain())(const char *name) {
dougk updated this revision to Diff 56656.May 9 2016, 7:19 PM

fix declaration

zaks.anna accepted this revision.Jun 21 2016, 2:30 PM
zaks.anna edited edge metadata.

Should I commit or do you have commit access?

This revision is now accepted and ready to land.Jun 21 2016, 2:30 PM
jroelofs added inline comments.Jun 22 2016, 9:02 AM
lib/stats/stats_client.cc
33

erm... never mind. Confusing type is confusing.

A typedef would probably help readability here.