2015-06-01から1ヶ月間の記事一覧

gdbでgetopt()のoptind/optoptを参照したときに値が違うように見える

結構ハマったのでメモ。 #include <stdio.h> #include <getopt.h> char *short_opts = "ab:"; struct option long_opts[] = { {"test", no_argument, 0, 0}, {"add", required_argument, 0, 0}, {0, 0, 0, 0} }; int main(int argc, char *argv[]) { int c = 0; int longindex; </getopt.h></stdio.h>…

MacPortsのselfupdateがエラーになる件(MacOS X 10.7.5 Lion)

MacPortsを久しぶりに動かそうとしたら古いって言われたのでupdateしようとした。がエラー。 $ sudo port install xz Password: Warning: port definitions are more than two weeks old, consider using selfupdate Error: Insufficient privileges to writ…