- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#includeWith these flags:#include int main(int argc, char* argv[]) { uintmax_t ui = 1; intmax_t si = -1; printf ("%ju, %jd\n", ui, si); return 0; }
icc -w3 -std=c99 printf_bug.cI get these remarks:
printf_bug.c(8): remark #181: argument of type "uintmax_t={unsigned long}" is incompatible with format "%ju", expecting argument of type "unsigned long long" printf ("%ju, %jd", ui, si); ^ printf_bug.c(8): remark #181: argument of type "intmax_t={long}" is incompatible with format "%jd", expecting argument of type "long long" printf ("%ju, %jd", ui, si); ^However, the C99 standard defines the length modifier "j" as taking a argument of type uintmax_t/intmax_t. The same problem occurs with equivalent C++11 code. On this platform, long, long long, and uintmax_t are all 64 bits, so I feel safe ignoring the remark. Version: icc (ICC) 16.0.4 20160811 Architecture: x86_64 OS: RHEL 7.4
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Daniel
Have you tried your test with our latest version 18.0?
If it's still reproducible, please report bugs to Intel Online Service center , you will get a response from our support team then.
Thanks
Yolanda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I confirm that this bug is still present in the version 18.0.3.20180410. I get the following error message:
error #181: argument of type "intmax_t={__intmax_t={long}}" is incompatible with format "%jd", expecting argument of type "long long"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you compiled your test case at default, then you don't see the warning.
vahoang@orcsle147:/tmp$ gcc -std=c99 t.c -c
vahoang@orcsle147:/tmp$ icc -std=c99 t.c -c -V
Intel(R) C Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.3.222 Build 20180410
Copyright (C) 1985-2018 Intel Corporation. All rights reserved.
Edison Design Group C/C++ Front End, version 4.13 (Apr 10 2018 02:35:14)
Copyright 1988-2017 Edison Design Group, Inc.
vahoang@orcsle147:/tmp$ cat t.c
#include<stdio.h>
#include<stdint.h>
int main(int argc, char* argv[])
{
uintmax_t ui = 1;
intmax_t si = -1;
printf ("%ju, %jd\n", ui, si);
return 0;
}
This remark is very low priority, therefore it may take a long time to address.
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indeed, we do not compile with the default flags but as follows:
16:15:51 /opt/intel/bin/icpc [...] -fno-common -Wall -Wextra -Wunused -Wmissing-declarations -Wcomment -Wformat -Wwrite-strings -Wno-strict-aliasing -wd1418 -wd191 -wd3179 -ww597 -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Werror -g3 -std=gnu++11 -O3 -funroll-loops -fno-strict-aliasing -fprotect-parens -fPIC -o [...] -c [...]
(full logs: https://ci.inria.fr/simgrid/job/SimGrid/5937/build_mode=Debug,node=simgrid-fedora26/console )
Our work around is to use PRIdMAX instead of %jd. Commit: https://framagit.org/simgrid/simgrid/commit/819942b4ca0be7a019133420d20004abf80de221
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page