diff options
author | David Reiss <dreiss@apache.org> | 2008-06-30 20:45:47 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2008-06-30 20:45:47 +0000 |
commit | f14541626d1c49cb1439d65e81fa3609c23b7cf0 (patch) | |
tree | 0b58c296fdf9f66169f70e368c948ade2a1a510c /test/BrokenConstants.thrift | |
parent | dd08f6d5a5bbc39b4ab30a3cb6996b39f7605f06 (diff) | |
download | thrift-f14541626d1c49cb1439d65e81fa3609c23b7cf0.tar.gz |
Partial handlling of 64-bit integer constants.
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.
I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work. However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/BrokenConstants.thrift')
-rw-r--r-- | test/BrokenConstants.thrift | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/BrokenConstants.thrift b/test/BrokenConstants.thrift new file mode 100644 index 000000000..4c47b3380 --- /dev/null +++ b/test/BrokenConstants.thrift @@ -0,0 +1,6 @@ +const i64 myint = 68719476736 +const i64 broken = 9876543210987654321 // A little over 2^63 + +enum foo { + bar = 68719476736 +} |