View Issue Details

IDProjectCategoryView StatusLast Update
0004023libmicrohttpdexternal APIpublic2015-10-31 15:06
Reportermatwey Assigned ToKarlson2k Due Date
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 15: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 21: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 12:26

manager   ~0009803

Should be fixed in SVN 36593

Issue History

Date ModifiedUsernameFieldChange
2015-10-24 21:26matweyNew Issue
2015-10-25 15:25Christian GrothoffNote Added: 0009786
2015-10-26 21:13Karlson2kNote Added: 0009800
2015-10-26 23:39Christian GrothoffAssigned To => Karlson2k
2015-10-26 23:39Christian GrothoffStatusnew => assigned
2015-10-26 23:39Christian GrothoffTarget Version => 0.9.45
2015-10-27 12:26Karlson2kNote Added: 0009803
2015-10-27 12:26Karlson2kResolutionopen => fixed
2015-10-27 12:34Christian GrothoffStatusassigned => resolved
2015-10-27 12:34Christian GrothoffFixed in Version => 0.9.45
2015-10-31 15:06Christian GrothoffStatusresolved => closed
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API