mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Disabled using non-int-size types to declare bit-fields.
This commit is contained in:
parent
c37f9f1a41
commit
cbb33f86e8
@ -601,6 +601,26 @@ INLINE int IsSignSigned (const Type* T)
|
||||
# define IsSignSigned(T) (GetSignedness (T) == T_SIGN_SIGNED)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INLINE)
|
||||
INLINE TypeCode GetRawSizeModifier(const Type* T)
|
||||
/* Get the size modifier of a raw type */
|
||||
{
|
||||
return (T->C & T_MASK_SIZE);
|
||||
}
|
||||
#else
|
||||
# define GetRawSizeModifier(T) ((T)->C & T_MASK_SIZE)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INLINE)
|
||||
INLINE TypeCode GetSizeModifier (const Type* T)
|
||||
/* Get the size modifier of a type */
|
||||
{
|
||||
return (GetUnderlyingTypeCode (T) & T_MASK_SIZE);
|
||||
}
|
||||
#else
|
||||
# define GetSizeModifier(T) (GetUnderlyingTypeCode (T) & T_MASK_SIZE)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INLINE)
|
||||
INLINE TypeCode GetQualifier (const Type* T)
|
||||
/* Get the qualifier from the given type string */
|
||||
@ -696,16 +716,6 @@ int IsVariadicFunc (const Type* T) attribute ((const));
|
||||
** variable parameter list
|
||||
*/
|
||||
|
||||
#if defined(HAVE_INLINE)
|
||||
INLINE TypeCode GetSizeModifier (const Type* T)
|
||||
/* Get the size modifier of a type */
|
||||
{
|
||||
return (T->C & T_MASK_SIZE);
|
||||
}
|
||||
#else
|
||||
# define GetSizeModifier(T) ((T)->C & T_MASK_SIZE)
|
||||
#endif
|
||||
|
||||
FuncDesc* GetFuncDesc (const Type* T) attribute ((const));
|
||||
/* Get the FuncDesc pointer from a function or pointer-to-function type */
|
||||
|
||||
|
@ -689,6 +689,13 @@ static int ParseFieldWidth (Declaration* Decl)
|
||||
Error ("Bit-field has invalid type '%s'", GetBasicTypeName (Decl->Type));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (SizeOf (Decl->Type) != SizeOf (type_uint)) {
|
||||
/* Only int sized types may be used for bit-fields for now */
|
||||
Error ("CC65 currently only supports unsigned int bit-fields");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (Expr.IVal < 0) {
|
||||
Error ("Negative width in bit-field");
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user