forked from pyccel/pyccel
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When compiling C/C++ code using nvcc or any C++11-compliant compiler, a warning may appear due to the usage of the PRId64 macro in printf statements. The warning:
To Reproduce
Provide code to reproduce the behavior:
test.py
a = 10
print(a)test.cu
#include "test.h"
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdbool.h>
int64_t a;
bool initialised;
/*........................................*/
void test__init(void)
{
if (!initialised)
{
a = INT64_C(10);
printf("%"PRId64"\n", a);
initialised = 1;
}
}
/*........................................*/Error details
Provide the generated code, or the error message:
/home/said/Desktop/pyccel/__pyccel__/test.cu:17:16: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
17 | printf("%"PRId64"\n", a);
Expected behavior
This warning is triggered because C++11 requires a space between the % literal and the PRId64 macro in format strings.
A clear and concise description of what you expected to happen.
Language
cuda
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working