Skip to content

Logger: can't compile with Intel + invalid enum value

The compiler complains about this:

runner_others.c(772): error #188: enumerated type mixed with another type
                            /* flag= */ 0, /* flag_data= */ 0);

for this call:

          logger_log_part(e->logger, p, xp, e, /* log_all_fields= */ 0,
                          /* flag= */ 0, /* flag_data= */ 0);

(and similar ones just below)

That's easy to fix in principle by using the correct enum type here rather than just 0. However, there is a more fundamental problem here.

The function expects an enum of type logger_special_flags whose definition is:

enum logger_special_flags {
  logger_flag_change_type = 1, /* Flag for a change of particle type */
  logger_flag_mpi_enter, /* Flag for a particle received from another  MPI rank                                                                                                                                                                                                           
                          */
  logger_flag_mpi_exit,  /* Flag for a particle sent to another MPI rank */
  logger_flag_delete,    /* Flag for a deleted particle */
  logger_flag_create,    /* Flag for a created particle */
} __attribute__((packed));

With this definition, 0 is not a valid value covered by the enum. Not sure whether the functions behave correctly down the line with this case not being handled.

Edited by Matthieu Schaller
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information