delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/05/17/08:57:48

Date: Mon, 17 May 1993 14:21:02 +0200
From: sperber AT midi DOT informatik DOT uni-tuebingen DOT de (Michael Sperber [Mr. Preprocessor])
To: andy AT green DOT la DOT asu DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Problem with the preprocessor

Andy Vaught wrote:

>#define stringize(x) # x
>#define QSIZE 50
>
>printf("Message queue overflow! size = " stringize(QSIZE) );
>
>
>which gets preprocessed to:
>
>printf("Message queue overflow! size = " "QSIZE" );
>
>
>When what I am looking for is to get a "50" instead of "QSIZE".  TCC
>does this properly.  Any clues?
>

In that case, TCC is doing it improperly:  stringified macro arguments
_do not get expanded_ according to ANSI.  What is needed is:

#define magic_stringize(x) x
#define stringize(x) # x

Cheers =8-} Chipsy


- Raw text -


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