[scc-dev] next cpp issue

From: Tim Kelly <gtkelly_at_dialectronics.com>
Date: Mon, 06 Mar 2023 08:32:54 -0500

While the commit bcab2ba2573784415a25688bc1b4c116f4b8cbc5 fixed the
multiline issue, it did not fix all of the issues related to ANSI style
prototype declarations:

% cat ee.c
#include "ee.h"

void main(void) {

return;
}


% cat ee.h
#define _PROTOTYPE(function, params) function params

#ifdef _MINIX
/* Signal handler type, e.g. SIG_IGN */
typedef void _PROTOTYPE( (*sighandler_t), (int) );
#else
typedef void ( * sighandler_t ) ( int ) ;
#endif

% ./libexec/scc/cc1 -D _MINIX -E ee.c

#line 2 "ee.h"

#line 4

ee.h:5: error: #endif expected
typedef void ee.h:5: error: #endif expected

% ./libexec/scc/cc1 -E ee.c

#line 2 "ee.h"

#line 7
typedef void ( * sighandler_t ) ( int ) ;

#line 2 "ee.c"

void main ( void ) {

return ;
}
#line 6


The output above is from FreeBSD 13.1, showing this is not a Minix issue
(Minix is just revealing these issues).

tim

-- 
“When you’re accustomed to privilege, equality feels like oppression.”
		-- unattributed
--
To unsubscribe send a mail to scc-dev+unsubscribe_at_simple-cc.org
Received on Mon 06 Mar 2023 - 14:32:54 CET

This archive was generated by hypermail 2.3.0 : Fri 21 Apr 2023 - 16:20:39 CEST