Sun via Tinycc-devel [2025-05-16 11:03:50]:
#include
int main(int argc, char **argv)
{
int64_t a=111,b=222;
printf("%d %d\n",a,b);
return 0;
}
output:
111 0
On Linux, it prints "111 222". Need to include , or
"int64_t" is undefined.
--
Hilsen Harald
__
Or more appropriate, use “%lld” and use long long instead of int64_t
> On 16 May 2025, at 13:15, Sun via Tinycc-devel
> wrote:
>
> The problem is solved.
>
> int64_t a=123,b=234;
> printf("%llu %llu\n",a,b);
>
> Just use %llu .
>
> Thanks!
>
> -- 原始邮件 --
> 发件
> On 16 May 2025, at 14:29, Vincent Lefevre wrote:
>
> On 2025-05-16 13:29:09 +0200, Charlie Gordon wrote:
>> The correct portable way to print `int64_t` values is this:
>> ```
>> #include
>> #include
>> #include
>>
>> int main(int argc, char **argv) {
>> int64_t a =123, b = 234;
>> prin
On 2025-05-16 13:29:09 +0200, Charlie Gordon wrote:
> The correct portable way to print `int64_t` values is this:
> ```
> #include
> #include
> #include
>
> int main(int argc, char **argv) {
>int64_t a =123, b = 234;
>printf("%" PRId64 " %" PRId64 "\n", a, b);
>return 0;
> }
> ```
The correct portable way to print `int64_t` values is this:
```
#include
#include
#include
int main(int argc, char **argv) {
int64_t a =123, b = 234;
printf("%" PRId64 " %" PRId64 "\n", a, b);
return 0;
}
```
Microsoft compilers and libraries may be outdated and force you to use non
On 2025-05-16 15:48:35 +0200, Charlie Gordon wrote:
> On 16 May 2025, at 14:29, Vincent Lefevre wrote:
> > This is portable because int64_t necessarily fits in a long long on
> > any platform.
>
> This is correct, but only since C23. Previous versions of the C
> Standard would have allowed `long
The problem is solved.
int64_t a=123,b=234;
printf("%llu %llu\n",a,b);
Just use %llu .
Thanks!
-- --
??:
"avih"
The correct portable way to print `int64_t` values is this:
```
#include
#include
#include
int main(int argc, char **argv) {
int64_t a =123, b = 234;
printf("%" PRId64 " %" PRId64 "\n", a, b);
return 0;
}
```
Microsoft compilers and libraries may be outdated and force you to use non
p
Even better:
long long a = 123, b = 234;
printf("%lld %lld\n”, a, b);
Just use %lld and long long. %llu is for unsigned values.
Chqrlie.
> On 16 May 2025, at 13:15, Sun via Tinycc-devel
> wrote:
>
> The problem is solved.
>
> int64_t a=123,b=234;
> printf("%llu %llu\n",a,b);
>
> Just use
I can confirm this output on Windows with mob f10ab130
(2025-03-28), but only with tcc 32 bit build.
And, at least on Windows, it also needs #include
However, this program is buggy, because the format %d is for
int (32 bit on Windows), while the values are 64 bit, so
a mismatch and undefined beh
#include ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Can I use %lu? My os is windows.
#include https://lists.nongnu.org/mailman/listinfo/tinycc-devel___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
No. long is also 32 bit on Windows.
On Friday, May 16, 2025 at 02:00:54 PM GMT+3, Sun <809935...@qq.com> wrote:
Can I use %lu? My os is windows.
#include
#include
int main(int argc, char **argv)
{
int64_t a=123,b=234;
printf("%lu %lu\n",a,b);
return 0;
}
output:
123 0
-
Thank for your help!
-- --
??:
"tinycc-devel"
h
Under Linux/aarch64, when execute a function call with one arg is a struct, it
pass wrong arg to the function call.
a test code:
mmm.c
```c
#include
struct vec {
float x;
float y;
};
void bug(float y, float x) {
printf("x=%f\ny=%f\n",x,y);
}
float dot(struct vec v) {
return 10.0;
}
void mai
15 matches
Mail list logo