This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/67652] New: liboffloadmic/runtime/offload_engine.cpp:176: strange expression in sizeof ?


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

            Bug ID: 67652
           Summary: liboffloadmic/runtime/offload_engine.cpp:176: strange
                    expression in sizeof ?
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[trunk/liboffloadmic/runtime/offload_engine.cpp:176]: (warning) Found
calculation inside sizeof().

Source code is

            char * env_var = (char*) malloc(sizeof("COI_DMA_CHANNEL_COUNT=2" +
1));

Maybe better code

            char * env_var = (char*) malloc(sizeof("COI_DMA_CHANNEL_COUNT=2") +
1);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]