Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "James Harris" <james.harris.1@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: A data type for a wider integer than the compiler supports |
| Date | 2014-12-23 10:49 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <m7bhbo$gr4$1@dont-email.me> (permalink) |
| References | <m6rkel$t8k$1@dont-email.me><pan.2014.12.18.10.27.22.683000@nowhere.invalid><iib59al1i0jtqb8behdmqq8aamr1a4k46o@4ax.com><m6urcl$2d6$1@dont-email.me> <87zjakwve1.fsf@bsb.me.uk><m79gl4$4p3$1@dont-email.me> <m7a12i$pgd$1@dont-email.me><m7ak9u$1tf$1@speranza.aioe.org><68th9a5ioh6labt2587otipthfgtuavumc@4ax.com> <873886lmcf.fsf@bsb.me.uk> |
"Ben Bacarisse" <ben.usenet@bsb.me.uk> wrote in message
news:873886lmcf.fsf@bsb.me.uk...
> Robert Wessel <robertwessel2@yahoo.com> writes:
>
>> On Tue, 23 Dec 2014 02:33:35 -0000, "James Harris"
>> <james.harris.1@gmail.com> wrote:
>>
>>>"Ben Bacarisse" <ben.usenet@bsb.me.uk> wrote in message
>>>news:m7a12i$pgd$1@dont-email.me...
> <snip>
>>>> But you can check. Does bcc support struct passing etc?
> <snip>
>>>In a couple of simple tests I found that structs were copied and returned
>>>successfully but not passed. For example:
> <snip>
>>>struct pair printer(struct pair x) {
>>>
>>> printf("pair = %i,%i\n", x.a, x.b);
>>> return x;
>>>}
> <snip>
>> It has been *sooo* long since I've done a K&R prototype...
>>
>> But doesn't the second routine have to be:
>>
>>
>> struct pair printer(x)
>> struct pair x;
>> {
>> printf("pair = %i,%i\n", x.a, x.b);
>> return x;
>> }
>
> I was going to suggest just this. bcc handles ANSI function prototype
> with a pre-processing pass, so I'd certainly want to eliminate an error
> in that part of the compilation by reverting to K&R C. Mind you, that
> won't help James if he needs the -ansi flag for other reasons.
Yes, gcc compiles the same source files so the compatibility is needed.
It should probably always be a last resort to blame the compiler but in this
case it does look as though bcc may be at fault. Its struct passing assembly
code seems to push the memcpy length twice, once instead of the dest
pointer. I may make up a minimal example and see if there's somewhere I can
file a bug report.
James
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-17 10:04 +0000
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-18 02:48 -0600
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-18 14:30 +0000
Re: A data type for a wider integer than the compiler supports bert <bert.hutchings@btinternet.com> - 2014-12-18 11:49 -0800
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-18 14:27 -0600
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2015-01-27 16:30 +0000
Re: A data type for a wider integer than the compiler supports Thomas Richter <thor@math.tu-berlin.de> - 2015-01-29 15:53 +0100
Re: A data type for a wider integer than the compiler supports Bartc <bc@freeuk.com> - 2015-01-29 17:33 +0000
Re: A data type for a wider integer than the compiler supports Richard Heathfield <invalid@see.sig.invalid> - 2015-01-29 17:52 +0000
Re: A data type for a wider integer than the compiler supports Bartc <bc@freeuk.com> - 2015-01-29 18:24 +0000
Re: A data type for a wider integer than the compiler supports Richard Heathfield <invalid@see.sig.invalid> - 2015-01-29 18:42 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2015-01-30 09:56 +0000
Re: A data type for a wider integer than the compiler supports Richard Heathfield <invalid@see.sig.invalid> - 2015-01-30 10:13 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2015-01-30 13:21 +0000
Re: A data type for a wider integer than the compiler supports Greg Martin <greg.at.softsprocket@dot.com> - 2015-01-30 14:16 +0000
Re: A data type for a wider integer than the compiler supports Thomas Richter <thor@math.tu-berlin.de> - 2015-02-01 08:54 +0100
Re: A data type for a wider integer than the compiler supports Richard Heathfield <invalid@see.sig.invalid> - 2015-01-30 10:17 +0000
Re: A data type for a wider integer than the compiler supports BartC <bc@freeuk.com> - 2014-12-18 10:13 +0000
Re: A data type for a wider integer than the compiler supports BartC <bc@freeuk.com> - 2014-12-18 12:34 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-18 15:06 +0000
Re: A data type for a wider integer than the compiler supports Nobody <nobody@nowhere.invalid> - 2014-12-18 10:27 +0000
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-18 04:44 -0600
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-18 15:21 +0000
Re: A data type for a wider integer than the compiler supports Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-18 20:33 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-22 16:25 +0000
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-22 14:38 -0600
Re: A data type for a wider integer than the compiler supports Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-22 21:14 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-23 02:42 +0000
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-22 22:52 -0600
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-23 11:00 +0000
Re: A data type for a wider integer than the compiler supports Les Cargill <lcargill99@comcast.com> - 2014-12-23 14:46 -0600
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-24 05:21 -0600
Re: A data type for a wider integer than the compiler supports David Brown <david.brown@hesbynett.no> - 2014-12-23 08:13 +0100
Re: A data type for a wider integer than the compiler supports Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-22 20:02 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-23 02:33 +0000
Re: A data type for a wider integer than the compiler supports Robert Wessel <robertwessel2@yahoo.com> - 2014-12-22 23:05 -0600
Re: A data type for a wider integer than the compiler supports Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-23 09:57 +0000
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-23 10:49 +0000
Re: A data type for a wider integer than the compiler supports Kaz Kylheku <kaz@kylheku.com> - 2014-12-22 21:18 +0000
Re: A data type for a wider integer than the compiler supports Keith Thompson <kst-u@mib.org> - 2014-12-18 10:12 -0800
Re: A data type for a wider integer than the compiler supports Vincenzo Mercuri <nomail@yahoo.it> - 2014-12-18 18:52 +0100
Re: A data type for a wider integer than the compiler supports "James Harris" <james.harris.1@gmail.com> - 2014-12-18 18:17 +0000
csiph-web