Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 19, 2004 (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Hello. I'm working on a project with multiple files and all. Here is the code void logf(...) // this will cause a seg fault { // do logging stuff } bit logf(...) // this will work just fine { // do logging stuff return true; } I'm wondering why is it that when I use (...) for an argument, I must return a value or else it segfaults? |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | In article <cdgn2l$fk1$1@digitaldaemon.com>, clayasaurus says... > >Hello. I'm working on a project with multiple files and all. Here is the code > >void logf(...) // this will cause a seg fault >{ >// do logging stuff >} > >bit logf(...) // this will work just fine >{ >// do logging stuff >return true; >} > >I'm wondering why is it that when I use (...) for an argument, I must return a value or else it segfaults? oh! that's why! I experienced that and just remove the (...) parameter, changing the API of the thing of course. This is on DUI MessageDialog and nobody notice it. :( Ant |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | argh! wtf?! Ok, now I can use void logf(...) fine, however, if i don't pass at least 2 parameters it causes it to crash. :-| |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? - bug.d | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus Attachments: | Ok, here is something different but I think it is related some how. When I use writef it crashes, when i use printf it doesn't. This must be a bug, right? (see attachment) |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | but if i pass two or more arguments into writef than it doesn't crash! help! these seg-faults are eating away at my sssanityyz ahh!@ |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | and sometimes I have to pass at least 3 arguments or it causes it to crash. |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | i found it that it doesn't even seg fault inside the function. just the act of passing less than two or three arguments causes it to seg fault. |
July 19, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | a temporary solution is to pass 2 dummy arguments for my function like void logf(int dummy, int dummy2, ...) { char[] message = stamp(std.utf.toUTF8(formatstring(_arguments, _argptr))); gLogFile.writeString(message); } and it works. however it seems unnecessary and it's ugly. I hope there's a better way. |
July 24, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? - bug.d | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | "clayasaurus" <clayasaurus_member@pathlink.com> wrote in message news:cdgrdn$hig$1@digitaldaemon.com... > Ok, here is something different but I think it is related some how. When I use > writef it crashes, when i use printf it doesn't. > > This must be a bug, right? (see attachment) I can't reproduce the problem with your example. |
July 24, 2004 Re: (linux bug?) why is it that a function must return a value or it seg faults? - bug.d | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Fri, 23 Jul 2004 17:43:20 -0700, Walter wrote:
>
> "clayasaurus" <clayasaurus_member@pathlink.com> wrote in message news:cdgrdn$hig$1@digitaldaemon.com...
>> Ok, here is something different but I think it is related some how. When I
> use
>> writef it crashes, when i use printf it doesn't.
>>
>> This must be a bug, right? (see attachment)
>
> I can't reproduce the problem with your example.
I can't either but I had the same problem,
I'll post it if I can reduce it to 10 lines
Ant
|
Copyright © 1999-2021 by the D Language Foundation