summaryrefslogtreecommitdiff
path: root/libobjc/encoding.c
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-12 00:43:15 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-12 00:43:15 +0000
commitc3a945cde92094f4713cefdafe5c1bd3f07fbbcc (patch)
treee22bed6f4601015a5042c0e66fd318e63707468e /libobjc/encoding.c
parentf02cc357b43d02bd0cc19a701401ec8bd82985f0 (diff)
downloadgcc-c3a945cde92094f4713cefdafe5c1bd3f07fbbcc.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164223 138bc75d-0d04-0410-961f-82ee72b054a4
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 5694530a220..c0d79d9f349 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 ++;