Changeset 480:3fc488930adf in finroc_core


Ignore:
Timestamp:
12.12.2020 22:54:13 (2 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Children:
481:73b6dc18c7c4, 482:821a1922bd01
Phase:
public
Message:

Fixes clang compiler error (variable length array of non-POD element type)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tFrameworkElement.cpp

    r472 r480  
    521521  bool unique_result = link.GetChild().GetFlag(tFlag::GLOBALLY_UNIQUE_LINK); 
    522522  size_t parent_count = internal::CountNumberOfAncestors(link); 
    523   rrlib::uri::tStringRange path_elements[parent_count + 1];  // +1 for this 
     523  size_t required_path_elements = parent_count + 1; // +1 for this 
     524  char path_elements_memory[required_path_elements * sizeof(rrlib::uri::tStringRange)]; 
     525  memset(path_elements_memory, 0, sizeof(path_elements_memory)); 
     526  rrlib::uri::tStringRange* path_elements = reinterpret_cast<rrlib::uri::tStringRange*>(path_elements_memory); 
    524527  rrlib::uri::tStringRange* path_element = &path_elements[parent_count]; 
    525528  (*path_element) = link.GetName(); 
Note: See TracChangeset for help on using the changeset viewer.