You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/05/04 19:09:07 UTC
[GitHub] [daffodil] tuxji commented on a change in pull request #553: Fix a C portability problem
tuxji commented on a change in pull request #553:
URL: https://github.com/apache/daffodil/pull/553#discussion_r626029507
##########
File path: daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/infoset.c
##########
@@ -132,7 +132,8 @@ walkInfosetNode(const VisitEventHandler *handler, const InfosetBase *infoNode)
const ERD **const childrenERDs = infoNode->erd->childrenERDs;
const size_t * offsets = infoNode->erd->offsets;
- for (size_t i = 0; i < count && !error; i++)
+ size_t i;
+ for (i = 0; i < count && !error; i++)
{
const size_t offset = offsets[i];
Review comment:
Yes, I realized there is a setting we can use: -pedantic -std=gnu99. I've enabled it, found some more problems, and fixed them in my latest commit. The -pedantic option turns on some warnings about code that doesn't conform strictly to the C standard. The -std=gnu99 option checks the C99 standard with GNU extensions, allowing us to keep using <unistd.h> for getopt and so on for all the functions that aren't available with -std=c99. Note that there's nothing really GNU-ish about getopt, it's more of a Unix / POSIX extension than a GNU extension.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org