Use unsigned int as bitfield type #164

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@charliesome

Compiling any file that includes http_parser.h with -pedantic on GCC gives this warning:

inc/http_parser.h:196:3: warning: type of bit-field ‘type’ is a GCC extension [-pedantic]
inc/http_parser.h:197:3: warning: type of bit-field ‘flags’ is a GCC extension [-pedantic]
inc/http_parser.h:210:3: warning: type of bit-field ‘http_errno’ is a GCC extension [-pedantic]
inc/http_parser.h:217:3: warning: type of bit-field ‘upgrade’ is a GCC extension [-pedantic]

This pull request changes the types of the members of both bitfields in struct http_parser to be unsigned int, which fixes this warning.

This should pack just as well as what's there currently. On gcc 4.2.1 at least, there's no change in the total size of struct http_parser after applying this patch.

@bnoordhuis
Node.js Foundation member

Thanks, landed in 11419c8.

@bnoordhuis bnoordhuis closed this Nov 19, 2013
@charliesome charliesome deleted the charliesome:fix-bitfields branch Jan 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment