View Issue Details

IDProjectCategoryView StatusLast Update
0004023libmicrohttpdexternal APIpublic2015-10-31 16:06
Reportermatwey Assigned ToKarlson2k  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.44 
Target Version0.9.45Fixed in Version0.9.45 
Summary0004023: MHD_create_response_from_fd_at_offset: error: expected expression before ‘#pragma’
DescriptionHello,

When compiled with gcc 4.4.1 the following code

    struct MHD_Response *response;
    response = MHD_create_response_from_fd_at_offset(rsize, fd, offset);

leads to the following compilation error

    error: expected expression before ‘#pragma’

Preprocessed source is the following:

 response =
#pragma message "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()"
 MHD_create_response_from_fd_at_offset64((rsize),(fd),(offset));
TagsNo tags attached.

Activities

Christian Grothoff

2015-10-25 16:25

manager   ~0009786

Ok, that's very strange that the cpp doesn't expand #pragma.

The obvious workaround is to not use the deprecated API,
or to #define MHD_NO_DEPRECATION before #including "microhttpd.h"
or to upgrade to GCC 4.8 or higher.

Alternatively, maybe Karlson2K can find out why his deprecation macro-mania doesn't work as expected? I must admit I'm simply puzzled. His check is for GCC >= 4.8, so 4.4.1 is classified as "older" GCC here.

Karlson2k

2015-10-26 22:13

manager   ~0009800

Checked it with GCC 4.4.0 - error reproduced.
Will fix it.
As another possible workaround: replace usage of deprecated functions.

Karlson2k

2015-10-27 13:26

manager   ~0009803

Should be fixed in SVN 36593

Issue History

Date Modified Username Field Change
2015-10-24 23:26 matwey New Issue
2015-10-25 16:25 Christian Grothoff Note Added: 0009786
2015-10-26 22:13 Karlson2k Note Added: 0009800
2015-10-27 00:39 Christian Grothoff Assigned To => Karlson2k
2015-10-27 00:39 Christian Grothoff Status new => assigned
2015-10-27 00:39 Christian Grothoff Target Version => 0.9.45
2015-10-27 13:26 Karlson2k Note Added: 0009803
2015-10-27 13:26 Karlson2k Resolution open => fixed
2015-10-27 13:34 Christian Grothoff Status assigned => resolved
2015-10-27 13:34 Christian Grothoff Fixed in Version => 0.9.45
2015-10-31 16:06 Christian Grothoff Status resolved => closed
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API