Created attachment 7035 [details] the source code, complie it with and without -std=c99 to see the difference using the code show in getopt(3), complie it using gcc c99 option(-std=c99), then if we input like this: ./a.out name -t 10 the getopt() can not find the -t option and its value. it just stop at name. but if we complie it without -std=c99, things get right, we will get the -t and its value, and name is reorder at last position.
To get the GNU style getopt use <getopt.h> or define _GNU_SOURCE.
Closing as Andreas pointed out.