🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41444

GCC and Threads/Interrupts

#41444
From: tmc
Date: Mon, 08 Apr 1996 00:00
17 lines
1048 bytes
If a method returns an instance of a class, GCC places the return value,
(for reasons of efficiency) in a statically allocated section of memory (.lcomm).
This causes fatal problems when threads and interrupts call methods that
also modify this area of memory.

I have changed my code to avoid this situation but would prefer to make
coding decisions for reasons other than compiler limitations. It also makes it
very hard to write things like:

  friend Decimal operator + (Decimal &left, Decimal &right);

Does GCC support  a switch (or like) to return structures on the stack?

I'm running GCC 2.6.3 as a cross compiler under OS2 for the Motorola 68332.

Thanks
Mark Cyster
Technical Details
Message-ID: <4kb2h6$k1e@netnews.hinet.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,3d1bd3236cb97d8e,start
X-Google-Attributes: gid11318c,public
From: tmc@c2.hinet.net
Subject: GCC and Threads/Interrupts
Date: 1996/04/08
Message-ID: <4kb2h6$k1e@netnews.hinet.net>
X-Deja-AN: 146354611
organization: DCI HiNet
reply-to: tmc@ms2.hinet.net
newsgroups: gnu.gcc.help