From: chrubis@suse.cz
To: Mike Frysinger <vapier@gentoo.org>
Cc: Alexey Kodanev <alexey.kodanev@oracle.com>,
vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 4/4] lib: add tst_res_r.c
Date: Wed, 19 Feb 2014 16:19:31 +0100 [thread overview]
Message-ID: <20140219151931.GA22336@rei> (raw)
In-Reply-To: <2020103.1jVMlSvdbW@vapier>
Hi!
> > > random note: never never never use () with functions. always always
> > > always
> > > use (void). i'm guessing you're not aware, but what you've written here
> > > may>
> > > be called (warning free!) like so:
> > > get_tst_count(1, 2, 3);
> > >
> > > yes, even with -W -Wall -Wextra. please stamp this horrible habit out of
> > > your code.
> >
> > Thank you for explanation!
> > There is a trick to try g++ to compile the code, it will throw an error
> > on that and stops compilation.
>
> yeah, C++ fixed this historical wart of C. sorry for not clarifying.
>
> iiuc (and i could be wrong as i'm not old enough to have lived through it),
> this dates back to when C (ANSI?) didn't have prototypes. with a lot of code
> out there relying on the behavior, gcc never stopped accepting it.
That would be K&R C that dates back to UNIX days (at least from what
I've read about the history, haven't lived these days either).
> i wonder if we could argue for like a newer GNU standard to reject it.
That would be nice. Although there is a lot of code that dates back to
the old days, quite a lot of test in LTP as well so there is no way to
get this mandatory for existing projects, we simply have no manpower to
rewrite all the sources in a week or so. On the other way it would be
nice to instruct the compiler to abort on any new code that includes
old-style declarations.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-02-19 15:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 9:48 [LTP] [PATCH v2 2/4] lib/test.h: create macro to declare init/cleanup functions Alexey Kodanev
2014-02-11 9:48 ` [LTP] [PATCH v2 3/4] lib: compile *_r.c to libltp_r library, add testcases_r.mk Alexey Kodanev
2014-02-11 9:48 ` [LTP] [PATCH 4/4] lib: add tst_res_r.c Alexey Kodanev
2014-02-12 15:44 ` chrubis
[not found] ` <5128140.KmexAZrTeg@vapier>
2014-02-13 10:21 ` chrubis
[not found] ` <52FCA8DF.4030503@oracle.com>
2014-02-13 13:04 ` chrubis
2014-02-13 8:47 ` Mike Frysinger
2014-02-13 10:05 ` Alexey Kodanev
2014-02-13 23:06 ` Mike Frysinger
2014-02-14 13:59 ` Alexey Kodanev
2014-02-14 17:16 ` Mike Frysinger
2014-02-19 15:19 ` chrubis [this message]
2014-02-13 10:11 ` chrubis
2014-02-12 15:37 ` [LTP] [PATCH v2 2/4] lib/test.h: create macro to declare init/cleanup functions chrubis
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=20140219151931.GA22336@rei \
--to=chrubis@suse.cz \
--cc=alexey.kodanev@oracle.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=vapier@gentoo.org \
--cc=vasily.isaenko@oracle.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox