Skip to content

Commit 825575a

Browse files
authored
[small] tidy up warnings (#2323)
1 parent e00e781 commit 825575a

File tree

5 files changed

+117
-105
lines changed

5 files changed

+117
-105
lines changed

integration_tests/modules_02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modules_02b import f, f
1+
from modules_02b import f
22
from lpython import i32
33

44
def main0():

src/libasr/runtime/lfortran_intrinsics.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,13 @@ LFORTRAN_API void _lfortran_read_int64(int64_t *p, int32_t unit_num)
19911991
{
19921992
if (unit_num == -1) {
19931993
// Read from stdin
1994-
scanf("%lld", p);
1994+
scanf(
1995+
#ifdef HAVE_LFORTRAN_MACHO
1996+
"%lld"
1997+
#else
1998+
"%ld"
1999+
#endif
2000+
, p);
19952001
return;
19962002
}
19972003

@@ -2005,7 +2011,13 @@ LFORTRAN_API void _lfortran_read_int64(int64_t *p, int32_t unit_num)
20052011
if (unit_file_bin) {
20062012
fread(p, sizeof(*p), 1, filep);
20072013
} else {
2008-
fscanf(filep, "%lld", p);
2014+
fscanf(filep,
2015+
#ifdef HAVE_LFORTRAN_MACHO
2016+
"%lld"
2017+
#else
2018+
"%ld"
2019+
#endif
2020+
, p);
20092021
}
20102022
}
20112023

tests/reference/asr-modules_02-ec92e6f.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"basename": "asr-modules_02-ec92e6f",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/modules_02.py",
5-
"infile_hash": "c3ce0b2b9780f27f787297f75e5477e990481b962dcee420809540e0",
5+
"infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-modules_02-ec92e6f.stdout",
99
"stdout_hash": "20ce6ad550f4e6b83356075795a39dafee13dc48bebf2eaf65d13edd",
10-
"stderr": "asr-modules_02-ec92e6f.stderr",
11-
"stderr_hash": "132af04271d3bfd523848990e734bfa3c0aed6e4b85ec4eb87e66720",
10+
"stderr": null,
11+
"stderr_hash": null,
1212
"returncode": 0
1313
}

tests/reference/asr_json-modules_02-53952e6.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"basename": "asr_json-modules_02-53952e6",
33
"cmd": "lpython --show-asr --json --no-color {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/modules_02.py",
5-
"infile_hash": "c3ce0b2b9780f27f787297f75e5477e990481b962dcee420809540e0",
5+
"infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr_json-modules_02-53952e6.stdout",
9-
"stdout_hash": "c6ddff7faf420128366955f59e91126e3edb9c0367caed8c333562ec",
10-
"stderr": "asr_json-modules_02-53952e6.stderr",
11-
"stderr_hash": "132af04271d3bfd523848990e734bfa3c0aed6e4b85ec4eb87e66720",
9+
"stdout_hash": "c97d528fedb41f6d0e8bfa0cee1c0c9333844130b7694cb0cd5e2c4c",
10+
"stderr": null,
11+
"stderr_hash": null,
1212
"returncode": 0
1313
}

0 commit comments

Comments
 (0)