aboutsummaryrefslogtreecommitdiff
path: root/libobjc/encoding.c
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-09-12 00:43:15 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-09-12 00:43:15 +0000
commit7b8699866416f7a55116e19bf6fe2c28bae12a68 (patch)
treee22bed6f4601015a5042c0e66fd318e63707468e /libobjc/encoding.c
parent201fb1f2283994930d4bc07f9eaeaaf7d98052c0 (diff)
downloadgcc-7b8699866416f7a55116e19bf6fe2c28bae12a68.zip
gcc-7b8699866416f7a55116e19bf6fe2c28bae12a68.tar.gz
gcc-7b8699866416f7a55116e19bf6fe2c28bae12a68.tar.bz2
In libobjc/:
* objc/deprecated/objc_error.h: New file. * objc/objc-api.h: Include deprecated/objc_error.h instead of defining objc_error and related. * error.c: New file. Added _objc_abort function which replaces objc_error. No change in functionality as they both print an error and abort. * misc.c: File removed. Code moved into memory.c and error.c. * memory.c: New file. * objc-private/error.h: New file. * archive.c: Include objc-private/error.h and use _objc_abort instead of objc_error everywhere. * class.c: Same change. * encoding.c: Same change. * init.c: Same change, and simplified init_check_module_version. * memory.c: Same change. * sendmsg.c: Same change. * thr.c: Same change. * Makefile.in (OBJ_DEPRECATED_H): Added objc_error.h. (OBJ_H): Reordered list. (OBJS): Removed misc.lo, added memory.lo and error.lo. (OBJS_GC): Removed misc_gc.lo, added memory_gc.lo and error_gc.lo. (misc_gc.lo): Rule removed. (error_gc.lo): Rule added. (memory_gc.lo): Rule added. From-SVN: r164223
Diffstat (limited to 'libobjc/encoding.c')
-rw-r--r--libobjc/encoding.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index 5694530..c0d79d9 100644
--- a/libobjc/encoding.c
+++ b/libobjc/encoding.c
@@ -27,7 +27,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* FIXME: This file has no business including tm.h. */
+/* FIXME: This file contains functions that will abort the entire
+ program if they fail. Is that really needed ?
+*/
+
#include "objc-private/common.h"
+#include "objc-private/error.h"
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"
@@ -316,8 +321,11 @@ objc_sizeof_type (const char *type)
default:
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown complex type %s\n",
- type);
+ /* FIXME: Is this so bad that we have to abort the
+ entire program ? (it applies to all the other
+ _objc_abort calls in this file).
+ */
+ _objc_abort ("unknown complex type %s\n", type);
return 0;
}
}
@@ -325,7 +333,7 @@ objc_sizeof_type (const char *type)
default:
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ _objc_abort ("unknown type %s\n", type);
return 0;
}
}
@@ -491,8 +499,7 @@ objc_alignof_type (const char *type)
default:
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown complex type %s\n",
- type);
+ _objc_abort ("unknown complex type %s\n", type);
return 0;
}
}
@@ -500,7 +507,7 @@ objc_alignof_type (const char *type)
default:
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ _objc_abort ("unknown type %s\n", type);
return 0;
}
}
@@ -643,7 +650,7 @@ objc_skip_typespec (const char *type)
return ++type;
else
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "bad array type %s\n", type);
+ _objc_abort ("bad array type %s\n", type);
return 0;
}
@@ -684,7 +691,7 @@ objc_skip_typespec (const char *type)
default:
{
- objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ _objc_abort ("unknown type %s\n", type);
return 0;
}
}
@@ -882,9 +889,8 @@ objc_layout_structure (const char *type,
if (*type != _C_UNION_B && *type != _C_STRUCT_B)
{
- objc_error (nil, OBJC_ERR_BAD_TYPE,
- "record (or union) type expected in objc_layout_structure, got %s\n",
- type);
+ _objc_abort ("record (or union) type expected in objc_layout_structure, got %s\n",
+ type);
}
type ++;