www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/26/11:56:35

Date: Wed, 26 Feb 1997 18:43:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: David Jenkins <me AT jenkinsdavid DOT demon DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: register int variable Errors
In-Reply-To: <ws6jCCAYMEFzEwZ0@jenkinsdavid.demon.co.uk>
Message-ID: <Pine.SUN.3.91.970226183844.517C-100000@is>
MIME-Version: 1.0

On Wed, 26 Feb 1997, David Jenkins wrote:

> Yet when I change 
> int d;
> 
> to
> 
> register int d;
> 
> DJGPP gives the error "register name not specified for 'd'

Is `d' a global variable?  In other words, is it declared outside of any 
function?  If so, then you are using a GCC extension to ANSI C: the 
Standard doesn't allow global variables to be declared with a register 
qualifier.  GCC allows this, but it assumes that you mean to put that 
variable in a specific register, for purposes known to you (otherwise it 
makes no sense to put a global variable into a register, especially on a 
x86 CPU that has way too few registers to spare).

If the above is not your case, please post the shortest program (not a 
fragment) that triggers the error message.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019