re PR preprocessor/8497 (traditional preprocessor #if/#endif bug)
authorNeil Booth <neil@daikokuya.co.uk>
Fri, 8 Nov 2002 22:36:22 +0000 (22:36 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 8 Nov 2002 22:36:22 +0000 (22:36 +0000)
PR preprocessor/8497
PR preprocessor/8501
* cpptrad.c (scan_out_logical_line): A '#' from a macro doesn't
start a directive.  In assembler, #NUM is not a line directive.

From-SVN: r58938

gcc/ChangeLog
gcc/cpptrad.c

index b473c789acb4ba5117fb5fe6d000dc8eebb0feaf..5f5fee4ea6eb103c294a900cce0744687a2110d6 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-08  Neil Booth  <neil@daikokuya.co.uk>
+
+       PR preprocessor/8497
+       PR preprocessor/8501
+       * cpptrad.c (scan_out_logical_line): A '#' from a macro doesn't
+       start a directive.  In assembler, #NUM is not a line directive.
+
 2002-11-08  Neil Booth  <neil@daikokuya.co.uk>
 
        * cppmain.c (cpp_preprocess_file): Loop to pop any -included
index 51b0bfc9cb5d12f0930838f368d5f5ba61187d85..902ae493b6acd672287751eda243db29803cf32f 100644 (file)
@@ -682,7 +682,10 @@ scan_out_logical_line (pfile, macro)
          break;
 
        case '#':
-         if (out - 1 == pfile->out.base && !pfile->state.in_directive)
+         if (out - 1 == pfile->out.base
+             /* A '#' from a macro doesn't start a directive.  */
+             && !pfile->context->prev
+             && !pfile->state.in_directive)
            {
              /* A directive.  With the way _cpp_handle_directive
                 currently works, we only want to call it if either we
@@ -705,7 +708,8 @@ scan_out_logical_line (pfile, macro)
                {
                  bool do_it = false;
 
-                 if (is_numstart (*cur))
+                 if (is_numstart (*cur)
+                     && CPP_OPTION (pfile, lang) != CLK_ASM)
                    do_it = true;
                  else if (is_idstart (*cur))
                    /* Check whether we know this directive, but don't