From 710eefe85a976c438da255499fbefd1a6c989ef6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 9 Jul 2018 20:47:07 +0200 Subject: pkg/compiler: support negative integers Currently we have to use 0xffffffffffffffff to represent -1, and we can't express e.g. -20:20 int range. Support negative consts to fix both problems. --- docs/syscall_descriptions_syntax.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index c5db29864..a3ac4f9c9 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -78,7 +78,8 @@ flagname = "\"" literal "\"" ["," "\"" literal "\""]* ## Ints -`int8`, `int16`, `int32` and `int64` denote an integer of the corresponding size. `intptr` denotes a pointer-sized integer, i.e. C `long` type. +`int8`, `int16`, `int32` and `int64` denote an integer of the corresponding size. +`intptr` denotes a pointer-sized integer, i.e. C `long` type. By appending `be` suffix (e.g. `int16be`) integers become big-endian. @@ -260,7 +261,7 @@ hex literals, as `'`-surrounded char literals, or as symbolic constants extracted from kernel headers or defined by `define` directives. For example: ``` -foo(a const[10]) +foo(a const[10], b const[-10]) foo(a const[0xabcd]) foo(a int8['a':'z']) foo(a const[PATH_MAX]) -- cgit mrf-deployment