From: Slava Semushin <php-coder@ngs.ru> To: devel@lists.altlinux.org Cc: Yuriy Kashirin <kashirin@emict.com> Subject: [devel] volatile void для ф-ции Date: Sat, 09 Sep 2006 18:51:11 +0700 Message-ID: <auto-000306281618@intranet.ru> (raw) Здравствуйте! Пытаюсь восстановить собираемость netris с -Werror. Наткнулся на множественные предуреждения типа: proto.h:64: warning: type qualifiers ignored on function return type proto.h:65: warning: type qualifiers ignored on function return type При этом в proto.h: 64 ExtFunc volatile void die(char *msg); 65 ExtFunc volatile void fatal(char *msg); И в util.c: 263 ExtFunc volatile void die(char *msg) 264 { 265 perror(msg); 266 exit(1); 267 } 268 269 ExtFunc volatile void fatal(char *msg) 270 { 271 fprintf(stderr, "%s\n", msg); 272 exit(1); 273 } Вопрос простой: как это правильно исправить? Также хотелось бы узнать почему volatile и void не ужились вместе. Сейчас просто удалил volatile везде и предупреждения пропали. Насколько понимаю, volatile здесь вообще ненужен. Также попутно возник вопрос чисто программерский: имеет ли смысл определять ф-ции наподобие приведённых здесь die() и fatal(), чтобы потом везде не писать perror(); exit() и fprintf(); exit() ? Есть ли какие-нибудь минусы в таком подходе? Спасибо заранее! -- + Semushin Slava | php-coder @ ngs.ru + ALT Linux Team | php-coder @ altlinux.ru + Expand QA Team | vsemushin @ swsoft.com
next reply other threads:[~2006-09-09 11:51 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-09-09 11:51 Slava Semushin [this message] 2006-09-09 12:25 ` Damir Shayhutdinov 2006-09-14 0:21 ` Serge Pavlovsky 2006-09-14 0:37 ` Serge Pavlovsky
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=auto-000306281618@intranet.ru \ --to=php-coder@ngs.ru \ --cc=devel@lists.altlinux.org \ --cc=kashirin@emict.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git