VirtualBox

Changeset 73102 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jul 12, 2018 11:36:45 PM (7 years ago)
Author:
vboxsync
Message:

iprt/strcache: Try shut up gcc about array bounds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strcache.cpp

    r73097 r73102  
    683683    pBigEntry->Core.uHash       = (uint16_t)uHash;
    684684    pBigEntry->Core.cchString   = RTSTRCACHEENTRY_BIG_LEN;
    685     memcpy(pBigEntry->Core.szString, pchString, cchString);
    686     pBigEntry->Core.szString[cchString] = '\0';
     685    /* The following is to try avoid gcc warnings/errors regarding array bounds: */
     686    char *pszDst = pBigEntry->Core.szString;
     687    memcpy(pszDst, pchString, cchString);
     688    pszDst[cchString] = '\0';
     689    ASMCompilerBarrier();
    687690
    688691    return &pBigEntry->Core;
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