VirtualBox

Changeset 78053 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 9, 2019 10:16:54 AM (6 years ago)
Author:
vboxsync
Message:

iprt/path.h: Use RT_FLEXIBLE_ARRAY in RTPATHPARSED and RTPATHSPLIT to make newer GCC versions less cranky. [build fix] bugref:9172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/uri.cpp

    r76553 r78053  
    880880     * and get it slightly wrong here).
    881881     */
    882     RTPATHPARSED ParsedPath;
    883     int rc = RTPathParse(pszPath, &ParsedPath, sizeof(ParsedPath), fPathStyle);
     882    union
     883    {
     884        RTPATHPARSED ParsedPath;
     885        uint8_t      abPadding[sizeof(RTPATHPARSED)];
     886    } u;
     887    int rc = RTPathParse(pszPath, &u.ParsedPath, sizeof(u.ParsedPath), fPathStyle);
    884888    if (RT_SUCCESS(rc) || rc == VERR_BUFFER_OVERFLOW)
    885889    {
    886890        /* Skip leading slashes. */
    887         if (ParsedPath.fProps & RTPATH_PROP_ROOT_SLASH)
     891        if (u.ParsedPath.fProps & RTPATH_PROP_ROOT_SLASH)
    888892        {
    889893            if (fPathStyle == RTPATH_STR_F_STYLE_DOS)
     
    900904         */
    901905        static const char s_szPrefix[] = "file:///";
    902         size_t const      cchPrefix    = sizeof(s_szPrefix) - (ParsedPath.fProps & RTPATH_PROP_UNC ? 2 : 1);
     906        size_t const      cchPrefix    = sizeof(s_szPrefix) - (u.ParsedPath.fProps & RTPATH_PROP_UNC ? 2 : 1);
    903907        size_t cchEncoded = rtUriCalcEncodedLength(pszPath, cchPath, fPathStyle != RTPATH_STR_F_STYLE_DOS);
    904908
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette