ARM Technical Support Knowledge Articles

LONG UNSIGNED GENERATES SYNTAX ERROR

Applies to: General Topics

Answer


Information in this article applies to:


SYMPTOMS

If I declare a variable as:

long unsigned x;

I get a syntax error when I compile my file. This should be accepted since unsigned long is a valid type.

CAUSE

According to the ANSI C Standard, section 6.5.2 Type Specifiers (ANSI/ISO 9899-1990), only the following are valid type specifiers (comma separated sets designate the same type):

Since long unsigned is not included in the list, it is not a valid type specifier and results in a syntax error. Use unsigned long in your program.

MORE INFORMATION

Article last edited on: 2004-10-11 09:45:09

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential