This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to use C89 with certain C99 features
- From: richardcavell at mail dot com
- To: steffen dot dettmer at googlemail dot com, gcc-help at gcc dot gnu dot org
- Date: Tue, 05 Apr 2011 11:44:38 -0400
- Subject: Re: How to use C89 with certain C99 features
- References: <BANLkTin-U8s=XFLpBNm_qjn8QZSd3AbLig@mail.gmail.com>
We have such situations where the platforms w/o vaargs are
"small" anyway and the overhead for __FILE__ in the binaries is
bad anyway, so simple solution is to simply on those platforms do
/not/ use file and line; two implementations of myfunc: one with
Well, because it's a Wikipedia bot, it's entirely foreseeable that the
program will encounter an error through no fault of its own (Internet
connection goes down, Wikipedia servers lag, unusual activity on
Wikipedia results in rare unhandled error, etc). Error conditions have
to be reported, and __FILE__ is a part of that.
when having e.g.:
function func(long seconds)
{
struct timeval t = { seconds, 0 };
}
you should to use
function func(long seconds)
{
struct timeval t = { 0 };
t.tv_sec = seconds;
}
Okay, but what about if I have const members? Here's my handle (these
variables should all be globals but I'm told not to use them):
struct parameters
{
CURL *const curlhandle;
FILE *const fplog;
const struct buffers buffers;
const struct preferences prefs;
char *szloginname;
char *szedittoken;
};
typedef struct parameters *BOTHANDLE;