yamt commented on pull request #3170:
URL: https://github.com/apache/incubator-nuttx/pull/3170#issuecomment-806351495


   > > is it intentional to break standard-conforming apps, which does `extern 
char *optarg;` by itself?
   > > unfortunately it's how apps are expected to use this api.
   > > 
https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/getopt.html
   > 
   > No. It is an unintended consequence of replace global variables with 
accessor functions. Any better ideas?
   
   i don't have any better idea.
   i think this PR is a reasonable compromise.
   
   to me, it seems impossible to support the api properly in flat memory model.
   it might be possible to resolve it with some fancy compiler or linker 
features.
   but i guess it isn't something we want to do either.
   
   btw, strictly speaking, this should be per-process (task group?) instead of 
per-thread.
   probably it doesn't matter for usual usage patterns of this api though.
   


-- 
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:
[email protected]


Reply via email to