/* $NetBSD: opt_bacc.c,v 1.1 2021/10/16 03:20:13 rillig Exp $ */ /* $FreeBSD$ */ #indent input /* * Test the option -bacc, which forces a blank line around every conditional * compilation block. For example, in front of every #ifdef and after every * #endif. Other blank lines surrounding such blocks are swallowed. * * XXX: As of 2021-10-05, the option -bacc has no effect on declarations since * process_decl resets prefix_blankline_requested unconditionally. */ int a; #if 0 /* FIXME: need blank line above */ int b; #endif /* FIXME: need blank line below */ int c; int space_a; #if 0 /* FIXME: need blank line above */ int space_b; /* FIXME: need no blank line above */ #endif int space_c; const char * os_name(void) { #if defined(__NetBSD__) || defined(__FreeBSD__) return "BSD"; #else return "unknown"; #endif } #indent end #indent run -bacc /* * Test the option -bacc, which forces a blank line around every conditional * compilation block. For example, in front of every #ifdef and after every * #endif. Other blank lines surrounding such blocks are swallowed. * * XXX: As of 2021-10-05, the option -bacc has no effect on declarations since * process_decl resets prefix_blankline_requested unconditionally. */ int a; #if 0 /* FIXME: need blank line above */ int b; #endif /* FIXME: need blank line below */ int c; int space_a; #if 0 /* FIXME: need blank line above */ int space_b; /* FIXME: need no blank line above */ #endif int space_c; /* $ XXX: The '*' should not be set apart from the rest of the return type. */ const char * os_name(void) { #if defined(__NetBSD__) || defined(__FreeBSD__) /* $ FIXME: This empty line _below_ the '#if' contradicts the manual page. */ return "BSD"; #else /* $ FIXME: This empty line _below_ the '#else' contradicts the manual page. */ return "unknown"; #endif /* $ FIXME: There should be an empty line after the '#endif'. */ } #indent end #indent input int a; #if 0 int b; #endif int c; int space_a; #if 0 int space_b; #endif int space_c; const char * os_name(void) { #if defined(__NetBSD__) || defined(__FreeBSD__) return "BSD"; #else return "unknown"; #endif } #indent end #indent run -nbacc int a; #if 0 int b; #endif int c; int space_a; #if 0 int space_b; #endif int space_c; const char * os_name(void) { #if defined(__NetBSD__) || defined(__FreeBSD__) return "BSD"; #else return "unknown"; #endif } #indent end