https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104964

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got something similar that can be seen in libqt5core library:

QByteArray qt_readlink(const char *path)
{
#ifndef PATH_MAX
    // suitably large value that won't consume too much memory
#  define PATH_MAX  1024*1024
#endif

    QByteArray buf(256, Qt::Uninitialized);

    ssize_t len = ::readlink(path, buf.data(), buf.size());

...

where they use something like:

struct QArrayData
{
...
    void *data()
    {
        return reinterpret_cast<char *>(this) + offset;
    }

Can't easily reproduce a small test can thought.

Reply via email to