11 messages in ru.sysoev.nginxRe: Compilation errors on Ubuntu 8.10...
FromSent OnAttachments
Eric BensonNov 10, 2008 9:38 am.log, .diff
Igor SysoevNov 10, 2008 12:34 pm.Other
Eric BensonNov 10, 2008 1:25 pm 
Maxim DouninNov 10, 2008 1:35 pm 
Igor SysoevNov 10, 2008 1:43 pm 
Eric BensonNov 10, 2008 2:27 pm 
Maxim DouninNov 10, 2008 3:47 pm 
Maxim DouninNov 10, 2008 4:29 pm.txt
Igor SysoevNov 10, 2008 10:35 pm.Other
Eric BensonNov 10, 2008 11:24 pm 
mikeNov 10, 2008 11:33 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Compilation errors on Ubuntu 8.10 Intrepid IbexActions...
From:Maxim Dounin (mdou@mdounin.ru)
Date:Nov 10, 2008 3:47:51 pm
List:ru.sysoev.nginx

Hello!

On Tue, Nov 11, 2008 at 12:43:54AM +0300, Igor Sysoev wrote:

On Tue, Nov 11, 2008 at 12:35:40AM +0300, Maxim Dounin wrote:

[...]

More details here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509

However I don't think it's a good idea to use stub variables. Probably something like

if (ngx_write_fd(...) == NGX_FILE_ERROR) { /* void */ }

would be better.

p.s. Actually I think that it's glibc's bug. But we probably have to live with it, at least for some time.

I believe this is gcc bug because I explictly says that I do not need the function result using (void) case.

It can't be gcc bug - warn_unused_result was explicitly coded to produce warning unavoidable by (void) cast. I agree that it's a misfeature though.

Anyway, there are many handwaving about this at the url I posted (and in other places as well). I don't think we want to repeat it here. :)

Dummy result checking as well as stub variable are security/reliabilty profanation.

With [dummy] result checking we have some good place where we can write reason why we can't do anything with the result, so it looks better for me than stub variable. Of course both aren't ideal.

The (void) cast should be compact way to do the same.

It should, but it isn't. The question now is how to live with it with minimal impact on decent systems. Probably the best solution would be just to omit -Werror on such systems.