Hello,

Is it possible to allow C++ constant expressions (currently static const,
and C++0x constexpr in the future) to be used as __attribute__ parameters
in the upcomming version of GCC? In my code I have the following construction:

    namespace simd {

       static const std::size_t vector_size = 16U;
    };

but cannot use it in order to declare a variable like this:

   std::uint8_t v[128] __attribute__((__aligned__(simd::vector_size)));

because GCC (4.4.0 snapshot from the end of January, x86/Cygwin)
complains that:

    error: expected ')' before '::' token

rewritten to:

    static const std::size_t len = 16;
    std::uint8_t v[128] __attribute__((__aligned__(len)));

results in:

    error: requested alignment is not a constant

One needs to introduce a preprocessor macro SIMD_VECTOR_SIZE
just in order to fix this particular issue.

    Best regards
    Piotr Wyderski

Reply via email to