public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Is this a bug?
@ 2009-07-17  4:23 Bill McEnaney
  0 siblings, 0 replies; 14+ messages in thread
From: Bill McEnaney @ 2009-07-17  4:23 UTC (permalink / raw)
  To: Bob Plantz, Ian Lance Taylor, Honggang Xu, Andrew Haley,
	David Daney, gcc-help

Bob told us his preference.  So I'll admit my preferences: Haskell,
Ocaml, Prolog, Python, and Lisp, probably in that order.

Bill

> On Thu, 2009-07-16 at 17:31 -0700, Ian Lance Taylor wrote:
> > For an integer type there is no performance difference between ++x and
> > x++.
> > 
> > For a C++ class which defines operator++ and a copy constructor, there
> > can be performance differences between ++x and x++.  The latter often
> > requires the compiler to invoke the copy constructor to hold onto the
> > old value before invoking operator++.  So if you are writing C++, it's
> > often a good idea to write ++x when x is a class type, such as an STL
> > iterator.  The compiler can sometimes eliminate the copy constructor,
> > but not always.
> > 
> > Ian
> 
> Thank you, Ian. Being mostly a C programmer, I often forget about the
> things that C++ does behind the scenes.
> 
> My real preference is assembly language. Then it's just me and the
> machine. ;)
> 
> Bob
> 
> 
> 

________________________________________________________________
Please visit a saintly hero:
http://www.jakemoore.org

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: Is this a bug?
@ 2003-08-21  9:23 Lev Assinovsky
  0 siblings, 0 replies; 14+ messages in thread
From: Lev Assinovsky @ 2003-08-21  9:23 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Gcc-Bugs (E-mail), Gcc-Help (E-mail)

The test case passed under gcc 3.3.1.
The problem was in lack of SOM weak support in gcc prior 3.3

----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909


> -----Original Message-----
> From: Alexandre Oliva [mailto:aoliva@redhat.com]
> Sent: Tuesday, August 12, 2003 10:57 PM
> To: Lev Assinovsky
> Cc: Gcc-Bugs (E-mail); Gcc-Help (E-mail)
> Subject: Re: Is this a bug?
> 
> 
> On Aug 12, 2003, "Lev Assinovsky" 
> <LAssinovsky@algorithm.aelita.com> wrote:
> 
> > gcc 3.2.3, HPUX-11.00:
> 
> > t.cpp: In static member function `static const item* A::f()':
> > t.cpp:6: warning: sorry: semantics of inline function 
> static data `const item 
> >    arr[1]' are wrong (you'll wind up with multiple copies)
> > t.cpp:6: warning:   you can work around this by removing 
> the initializer
> 
> It's not as much of a bug, but rather a limitation AFAIK imposed by
> the object file of the platform you've chosen.  GCC requires weak
> symbols in order to implement this feature correctly, and 32-bit HP-UX
> object files don't support them (completely?).
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist                Professional serial bug killer
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: Is this a bug?
@ 2003-08-14  9:47 Lev Assinovsky
  2003-08-15  5:04 ` Alexandre Oliva
  0 siblings, 1 reply; 14+ messages in thread
From: Lev Assinovsky @ 2003-08-14  9:47 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Gcc-Bugs (E-mail), Gcc-Help (E-mail)

But the program works after that warning.

----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909


> -----Original Message-----
> From: Alexandre Oliva [mailto:aoliva@redhat.com]
> Sent: Tuesday, August 12, 2003 10:57 PM
> To: Lev Assinovsky
> Cc: Gcc-Bugs (E-mail); Gcc-Help (E-mail)
> Subject: Re: Is this a bug?
> 
> 
> On Aug 12, 2003, "Lev Assinovsky" 
> <LAssinovsky@algorithm.aelita.com> wrote:
> 
> > gcc 3.2.3, HPUX-11.00:
> 
> > t.cpp: In static member function `static const item* A::f()':
> > t.cpp:6: warning: sorry: semantics of inline function 
> static data `const item 
> >    arr[1]' are wrong (you'll wind up with multiple copies)
> > t.cpp:6: warning:   you can work around this by removing 
> the initializer
> 
> It's not as much of a bug, but rather a limitation AFAIK imposed by
> the object file of the platform you've chosen.  GCC requires weak
> symbols in order to implement this feature correctly, and 32-bit HP-UX
> object files don't support them (completely?).
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist                Professional serial bug killer
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Is this a bug?
@ 2003-08-12 16:27 Lev Assinovsky
  2003-08-12 18:57 ` Alexandre Oliva
  0 siblings, 1 reply; 14+ messages in thread
From: Lev Assinovsky @ 2003-08-12 16:27 UTC (permalink / raw)
  To: Gcc-Bugs (E-mail), Gcc-Help (E-mail)

gcc 3.2.3, HPUX-11.00:

typedef struct  { int a, b; } item; 
class A {
public:
    static const item *  f()
        {
            static const item  arr[] = {{0,0}}; 
            return arr;
        }
};

The result:

t.cpp: In static member function `static const item* A::f()':
t.cpp:6: warning: sorry: semantics of inline function static data `const item 
   arr[1]' are wrong (you'll wind up with multiple copies)
t.cpp:6: warning:   you can work around this by removing the initializer

----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-07-17  4:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <DDFD17CC94A9BD49A82147DDF7D545C50176D5AE@exchange.ZeugmaSystems.local>
2009-07-16 18:07 ` Is this a bug? Honggang Xu
2009-07-16 18:17   ` Andrew Haley
2009-07-16 18:19   ` David Daney
2009-07-16 18:22     ` Andrew Haley
2009-07-16 18:28       ` Honggang Xu
2009-07-16 19:54         ` Bob Plantz
2009-07-17  0:31           ` Ian Lance Taylor
2009-07-17  2:48             ` Bob Plantz
2009-07-17  4:23 Bill McEnaney
  -- strict thread matches above, loose matches on Subject: below --
2003-08-21  9:23 Lev Assinovsky
2003-08-14  9:47 Lev Assinovsky
2003-08-15  5:04 ` Alexandre Oliva
2003-08-12 16:27 Lev Assinovsky
2003-08-12 18:57 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).