Skip to content

Missing include for time.h in reduce_stddev.c #115

@melroy-tellis

Description

@melroy-tellis

The reduce_stddev.c example is missing an include directive for the header <time.h>.

Running make results in the following error:

reduce_stddev.c: In function ‘main’:
reduce_stddev.c:43:9: error: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
   43 |   srand(time(NULL)*world_rank); // Seed the random number generator of processes uniquely
      |         ^~~~
reduce_stddev.c:15:1: note: ‘time’ is defined in header ‘<time.h>’; this is probably fixable by adding ‘#include <time.h>’
   14 | #include <assert.h>
  +++ |+#include <time.h>
   15 | 
make: *** [makefile:10: reduce_stddev] Error 1```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions