Skip to content

Commit 86e0068

Browse files
author
whitequark
committedJul 22, 2015
Use the correct printf format for 64-bit integers.
1 parent 236d5b8 commit 86e0068

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

Diff for: ‎artiq/compiler/transforms/artiq_ir_generator.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,13 @@ def flush():
13391339
ir.Constant("True", builtins.TStr()),
13401340
ir.Constant("False", builtins.TStr()))))
13411341
elif builtins.is_int(value.type):
1342-
format_string += "%d"
1342+
width = builtins.get_int_width(value.type)
1343+
if width <= 32:
1344+
format_string += "%ld"
1345+
elif width <= 64:
1346+
format_string += "%lld"
1347+
else:
1348+
assert False
13431349
args.append(value)
13441350
elif builtins.is_float(value.type):
13451351
format_string += "%g"

0 commit comments

Comments
 (0)
Please sign in to comment.