Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | diff --git a/value.c b/value.c |
| 2 | index d18db17..b98298e 100644 |
| 3 | --- a/value.c |
| 4 | +++ b/value.c |
| 5 | @@ -1,6 +1,6 @@ |
| 6 | /* |
| 7 | * This file is part of ltrace. |
| 8 | - * Copyright (C) 2011,2012 Petr Machata, Red Hat Inc. |
| 9 | + * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public License as |
| 13 | @@ -282,9 +282,9 @@ value_init_deref(struct value *ret_val, struct value *valp) |
| 14 | if (value_extract_word(valp, &l, NULL) < 0) |
| 15 | return -1; |
| 16 | |
| 17 | - /* We need "long" to be long enough to hold platform |
| 18 | + /* We need "long" to be long enough to hold target |
| 19 | * pointers. */ |
| 20 | - typedef char assert__long_enough_long[-(sizeof(l) < sizeof(void *))]; |
| 21 | + assert(sizeof(l) >= sizeof(arch_addr_t)); |
| 22 | |
| 23 | value_common_init(ret_val, valp->inferior, valp, |
| 24 | valp->type->u.ptr_info.info, 0); |
| 25 | diff --git a/lens_default.c b/lens_default.c |
| 26 | index ed3d0e1..5d00814 100644 |
| 27 | --- a/lens_default.c |
| 28 | +++ b/lens_default.c |
| 29 | @@ -1,6 +1,6 @@ |
| 30 | /* |
| 31 | * This file is part of ltrace. |
| 32 | - * Copyright (C) 2011,2012 Petr Machata, Red Hat Inc. |
| 33 | + * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc. |
| 34 | * Copyright (C) 1998,2004,2007,2008,2009 Juan Cespedes |
| 35 | * Copyright (C) 2006 Ian Wienand |
| 36 | * Copyright (C) 2006 Steve Fink |
| 37 | @@ -342,9 +342,9 @@ format_array(FILE *stream, struct value *value, struct value_dict *arguments, |
| 38 | struct expr_node *length, size_t maxlen, int before, |
| 39 | const char *open, const char *close, const char *delim) |
| 40 | { |
| 41 | - /* We need "long" to be long enough to cover the whole address |
| 42 | - * space. */ |
| 43 | - typedef char assert__long_enough_long[-(sizeof(long) < sizeof(void *))]; |
| 44 | + /* We need "long" to be long enough to cover the whole target |
| 45 | + * address space. */ |
| 46 | + assert(sizeof(long) >= sizeof(arch_addr_t)); |
| 47 | long l; |
| 48 | if (expr_eval_word(length, value, arguments, &l) < 0) |
| 49 | return -1; |