Github user pbchou commented on the pull request:
https://github.com/apache/trafficserver/pull/571#issuecomment-219549881
I think this depends on whether GNU extensions are being used or not since
the man page does say that you "must" reinitialize with optind = 0 if you go
back and forth between traditional and GNU extensions between scans. I am not
certain what constitutes a GNU extension in the opstring, but I can report that
two of the plugins included in this PR (background_fetch and regex_revalidate),
which both use optind = 1 currently, do not play well together.
background_fetch uses opstring "lc" while regex_revalidate uses "c:l:" so I
suspect the colons are considered GNU extensions since that is the only
difference besides the order of the letters. So sounds like glibc requires 0
and other libraries require 1 so this would need an #ifdef then. Note, there
are actually 15 plugins using getopt (11 use optind=0 and 4 use optind=1).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---