Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time too many

From: N Smethurst <nick.smethurst@email-addr-hidden>
Date: Thu Jun 09 2005 - 10:40:23 EEST

Chris Cannam a écrit :

>Yes, indeed, but a couple of times here I've seen observations that a
>vector would compile to an array if optimisation was on, etc. Since
>we're mostly using gcc-3.3+ now, I wanted to ask if anyone is sure
>whether that's really true.
>
>
Since a vector is a wrapped C array (i.e. contigous), the [] operator
compiles to the C equivalent when optimisation is turned on. The result
is the same as a C array.

Thinking about it logically, why would the developers of a C++ standard
library choose a different method? The std::vector is meant to be the
C++ replacement to C arrays, so a slow down in speed would effectively
render it useless.

However, last time I checked, GCC does not inline functions with -02
(only with -O3), so I always specify -finline-functions when compiling.
Received on Thu Jun 9 12:15:07 2005

This archive was generated by hypermail 2.1.8 : Thu Jun 09 2005 - 12:15:08 EEST