View Issue Details

IDProjectCategoryView StatusLast Update
0004911libmicrohttpdportabilitypublic2021-09-02 17:54
Reportertomasheran Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAnyOSSolarisOS Version11.next
Product Version0.9.52 
Target Version0.9.53Fixed in Version0.9.53 
Summary0004911: Solaris Studio 12.4 reports type mismatch when assigning NULL to response->crc and response->crfc in response.c
DescriptionWhen Solaris Studio 12.4 on Solaris 11.next is used and XPG7 support is requested, NULL is defined as ((void *)0) and the compiler then reports a type mismatch when trying to assign this NULL to function pointer type variables.
TagsNo tags attached.

Activities

Christian Grothoff

2017-02-22 18:51

manager   ~0011831

Ok, interesting. So how would one fix this cleanly? I do NOT plan on casting all NULL-assignments everywhere, that'd be ultra-ugly.

I mean, in this special case we can change the code to avoid the assignment due to the calloc's, but still...

tomasheran

2017-02-23 10:30

reporter   ~0011837

What I did to fix this on my end was to cast plain old 0 to e.g. MHD_ContentReaderCallback. Uncasted 0 seems to work as well (as in - Solaris Studio 12.4 does not complain), BTW.

Thing to note - this only affects assigning this ((void*)0) NULL to a function pointer typed variable. This seems to happen only on two lines in response.c and so one definitely wouldn't need to call all NULL-assignments everywhere.

And as you say, in the case of response.c, the whole "situation" would possible be better resolved using calloc() in the first place.

Christian Grothoff

2017-02-23 10:33

manager   ~0011838

Well, it uses calloc already, it's just that we _also_ set explicitly to NULL.

tomasheran

2017-02-23 10:46

reporter   ~0011839

Ah, sorry, missed that as 0.9.52 still calls malloc() and my eye was too lazy to go to the next line where it calls memset(0, ...).

Anyway, are you OK then with just deleting the two offending lines not to trip up Solaris Studio 12.4.? Thanks.

Christian Grothoff

2017-02-23 12:20

manager   ~0011840

Fixed in 813fc20..0bf22e8

Christian Grothoff

2021-09-02 17:54

manager   ~0018184

Fix committed to master branch.

Related Changesets

libmicrohttpd: master 0bf22e85

2017-02-23 13:20

Christian Grothoff


Details Diff
fix 0004911 Affected Issues
0004911
mod - src/microhttpd/response.c Diff File

Issue History

Date Modified Username Field Change
2017-02-22 13:17 tomasheran New Issue
2017-02-22 18:51 Christian Grothoff Note Added: 0011831
2017-02-22 18:51 Christian Grothoff Status new => feedback
2017-02-23 10:30 tomasheran Note Added: 0011837
2017-02-23 10:30 tomasheran Status feedback => new
2017-02-23 10:33 Christian Grothoff Note Added: 0011838
2017-02-23 10:46 tomasheran Note Added: 0011839
2017-02-23 12:20 Christian Grothoff Assigned To => Christian Grothoff
2017-02-23 12:20 Christian Grothoff Status new => resolved
2017-02-23 12:20 Christian Grothoff Resolution open => fixed
2017-02-23 12:20 Christian Grothoff Fixed in Version => 0.9.53
2017-02-23 12:20 Christian Grothoff Note Added: 0011840
2017-02-23 12:20 Christian Grothoff Target Version => 0.9.53
2017-04-12 00:00 Christian Grothoff Status resolved => closed
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master 0bf22e85
2021-09-02 17:54 Christian Grothoff Note Added: 0018184