C30 quadWord

OP #1630480
Lesenswert?

Hallo,

ich bekomme es nicht hin, im C30 Compiler ne quadWord Variable zu 
benutzen.
1
int main(void){
2
  unsigned long long test = 0xFFFFFFFFFFFFFFFF;

Darauf sagt mir der Compiler:

vfd.c: In function 'main':
vfd.c:22: warning: integer constant is too large for 'long' type
(Zeilen entsprechen dem Code.)

Die limits.h bei den Includes des Compilers sagt aber z.B.
1
/* long properties */
2
#define LONG_MAX   0x7fffffff
3
#define LONG_MIN   (-LONG_MAX -1)
4
#define ULONG_MAX  0xffffffffU
5

6
/* long long properties */
7
#define LLONG_MAX  0x7fffffffffffffffLL
8
#define LLONG_MIN  (-LLONG_MAX -1)
9
#define ULLONG_MAX 0xffffffffffffffffUL

Hat mir jemand einen Tipp, wie man das zum Laufen bringen kann?
Ich brauche so große Variablen um Seriennummern zu speichern. Natürlich 
könnte man das auch splitten, aber mit quadWords wäre es 
übersichtlicher.

Mfg, nEmai
#1630482
Lesenswert?

ich finde RTFM so einen dummen Spruch, aber in dem Falle stehts wirklich 
drinnen.


The compiler supports data types for integers that are twice as long as 
long int.
Simply write long long int for a signed integer, or unsigned long long 
int
for an unsigned integer. To make an integer constant of type long long 
int, add the
suffix LL to the integer. To make an integer constant of type unsigned 
long long
int, add the suffix ULL to the integer.

1
unsigned long long int test = 0xFFFFFFFFFFFFFFFFULL;

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren