View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004911 | libmicrohttpd | portability | public | 2017-02-22 13:17 | 2021-09-02 17:54 |
Reporter | tomasheran | Assigned To | Christian Grothoff | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Any | OS | Solaris | OS Version | 11.next |
Product Version | 0.9.52 | ||||
Target Version | 0.9.53 | Fixed in Version | 0.9.53 | ||
Summary | 0004911: Solaris Studio 12.4 reports type mismatch when assigning NULL to response->crc and response->crfc in response.c | ||||
Description | When 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. | ||||
Tags | No tags attached. | ||||
|
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... |
|
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. |
|
Well, it uses calloc already, it's just that we _also_ set explicitly to NULL. |
|
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. |
|
Fixed in 813fc20..0bf22e8 |
|
Fix committed to master branch. |
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 |