[lkml]   [2004]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectquestion on common error-handling idiom

There's something I've been wondering about for a while. There is a lot of code
in linux that looks something like this:

if (error condition)
goto out;

While nice to read, it would seem that it might be more efficient to do the

if (error condition) {
goto out;

Is there any particular reason why the former is preferred? Is the compiler
smart enough to optimize away the additional write in the non-error path?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:07    [W:0.063 / U:13.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site