This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use C89 with certain C99 features



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;





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]