warning: pasting would not give a valid preprocessing token

Zack Weinberg zack@wolery.cumb.org
Mon Sep 11 21:44:00 GMT 2000


On Thu, Sep 07, 2000 at 03:04:13PM -0400, Byron Stanoszek wrote:
> 
> Close, but no cigar. Actually, it hushed all of the warnings in
> every single .c file (about 45 of them individually), except for
> this one line. I took apart the .c file and made a small testcase
> that you can compile as described below.

...
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
> 
> /* tprintf(): prints to a temporary variable 16k in size */
> extern char global_buff[16384];
> #define tprintf(format, args...) (sprintf(global_buff, format, ## args), \
>                                   (char *)global_buff)
> 
> extern char *wtime(unsigned long, int);
> extern char *center(char *, int, char);
> 
> void test()
> {
>   char buf[256];
>   strcpy(buf, center(tprintf("<%s>", strchr(wtime(-1L, 1), ' ')+1), 63, ' '));
> }
> 
> winds:~/mare/src> gcc -Wall -O3 test.c -c
> test.c:16:77: warning: pasting would not give a valid preprocessing token

This is being caused by interference from glibc's damn string macros.
I don't have time to investigate any deeper now or in the near future,
sorry.  Neil, if you get a chance could you look at this?

zw


More information about the Gcc mailing list