Skip to content

Compilation problems with gcc 13.1.0

GCC 13.1.0 seems unhappy with the following lines of code:

void append_dataset(const struct unit_system *snapshot_units,
                    enum unit_conversion_factor units,
                    float scale_factor_exponent, hid_t loc_id, const char *name,
                    hid_t mem_type_id, hsize_t chunk_size,
                    int lossy_compression,
                    enum lossy_compression_schemes compression_scheme,
                    int gzip_level, const int rank, const hsize_t *dims,
                    const hsize_t num_written, const void *data) {

// SNIP

  /* Determine size of the dataset after we append our data */
  hsize_t full_dims[max_rank];
  for (int i = 0; i < rank; i += 1) full_dims[i] = dims[i];
  full_dims[0] += num_written;

as they produce this error:

../../src/lightcone/lightcone_particle_io.c: In function 'append_dataset':
../../src/lightcone/lightcone_particle_io.c:658:50: error: '__builtin_memcpy' forming offset [16, 23] is out of the bounds [0, 16] of object 'full_dims.89' with type 'unsigned char[16]' [-Werror=array-bounds=] 
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information