On 07/07/2017 23:10, Samuel Rakitničan wrote:
> Hi,
>
> Recently I've stumbled upon an compilation issue for ppc64le that is
> specific only to epel7. Program author says that the code is looking right
> and that there might be some issues with the platform [1]. cbang itself
> builds fine for i686 and x86_64 architectures on epel7.
>
> src/cbang/tar/TarHeader.cpp:226:43: error: format '%llo' expects
> argument of type 'long long unsigned int', but argument 4 has type
> 'uint64_t {aka long unsigned int}' [-Werror=format=]
> sprintf(buf, "%0*" PRIo64, length - 1, n);
> ^
>
> The build that failed can be found on the following link:
>
https://copr.fedorainfracloud.org/coprs/srakitnican/ppc64le-
> tests/build/576355/
>
>
> Best regards,
> Samuel Rakitničan
>
>
> [1]
https://github.com/CauldronDevelopmentLLC/cbang/issues/21#
> issuecomment-313770740
> _______________________________________________
> ppc mailing list -- ppc(a)lists.fedoraproject.org
> To unsubscribe send an email to ppc-leave(a)lists.fedoraproject.org
>
>
Hello Samuel,
I did a small C code snippet (not c++) to mimic the error code flow of
issue reported in (1) and was able to build and run it on a ppc64le guest
in my own environment (in fc24, fc25 and epel7)
Do you have the same with a C++ snipet ?
===
[root@vm52 test]# cat tstuint64.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
void writeNumber(uint64_t n, char *bug, uint32_t length) {
sprintf(bug, "%0*" PRIo64, length -1, n);
}
int main (int argc, char *argv[])
{
uint64_t value;
char buffer[12];
if (argc < 2) {
fprintf(stderr, "usage: tstuint64 <value>\n");
return 1;
}
value = strtoul(argv[1], NULL, 0);
writeNumber(value, buffer, 12);
printf("out str: %s\n", buffer);
return 0;
}
===
# ./tstuint64 4096
out str: 00000010000
===
Hi Michel,
I don't have any problems with your snipped either. I've reached out to
Joseph (cbang author), until then I don't have anything to offer, sorry.
Thank you for taking a look into this.
Regards,
Samuel Rakitničan