PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Re: Register variables doubt
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Register variables doubt

Réponse
 
LinkBack Outils de la discussion
Vieux 22/10/2007, 02h00   #1
David Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Register variables doubt

On Sat, 06 Oct 2007 12:17:12 -0700, Keith Thompson <kst-u@mib.org>
wrote:

> santosh <santosh.k83@gmail.com> writes:
> [...]
> > Personally I'd prefer the Standardisation of the asm keyword and
> > associated semantics, as has been done with C++, than further messing
> > around with register.

>
> C++ defines the asm keyword and its syntax:
>
> asm ( string-literal ) ;
>
> but leaves its semantics entirely implementation-defined.
>
> I'm not convinced that this is useful. Any program that uses ``asm''
> is inherently non-portable, and must be modified if it's to be ported
> to another platform. I don't see how standardizing part of the syntax
> aids portability (or anything else).


It allows other tools to correctly parse (the C part of) the code
without needing to know the asm quirks for particular compiler(s).

- formerly david.thompson1 || achar(64) || worldnet.att.net
  Réponse avec citation
Vieux 22/10/2007, 09h21   #2
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Register variables doubt

David Thompson <dave.thompson2@verizon.net> writes:
> On Sat, 06 Oct 2007 12:17:12 -0700, Keith Thompson <kst-u@mib.org>
> wrote:
>> santosh <santosh.k83@gmail.com> writes:
>> [...]
>> > Personally I'd prefer the Standardisation of the asm keyword and
>> > associated semantics, as has been done with C++, than further messing
>> > around with register.

>>
>> C++ defines the asm keyword and its syntax:
>>
>> asm ( string-literal ) ;
>>
>> but leaves its semantics entirely implementation-defined.
>>
>> I'm not convinced that this is useful. Any program that uses ``asm''
>> is inherently non-portable, and must be modified if it's to be ported
>> to another platform. I don't see how standardizing part of the syntax
>> aids portability (or anything else).

>
> It allows other tools to correctly parse (the C part of) the code
> without needing to know the asm quirks for particular compiler(s).


That's an *excellent* point.

In some circumstances, it might also be useful to write

#define asm(str) /* something-or-other */

though of course it's subject to abuse.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h15.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09713 seconds with 10 queries