OSDN Git Service

PR preprocessor/34692
[pf3gnuchains/gcc-fork.git] / libcpp / errors.c
index 2aa8140..97de490 100644 (file)
@@ -17,7 +17,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
  In other words, you are welcome to use, share and improve this program.
  You are forbidden to forbid anyone else to use, share and improve
@@ -140,20 +140,25 @@ cpp_error (cpp_reader * pfile, int level, const char *msgid, ...)
   
   va_start (ap, msgid);
 
-  if (CPP_OPTION (pfile, traditional))
-    {
-      if (pfile->state.in_directive)
-       src_loc = pfile->directive_line;
-      else
-       src_loc = pfile->line_table->highest_line;
-    }
+  if (CPP_OPTION (pfile, client_diagnostic))
+    pfile->cb.error (pfile, level, _(msgid), &ap);
   else
     {
-      src_loc = pfile->cur_token[-1].src_loc;
-    }
+      if (CPP_OPTION (pfile, traditional))
+       {
+         if (pfile->state.in_directive)
+           src_loc = pfile->directive_line;
+         else
+           src_loc = pfile->line_table->highest_line;
+       }
+      else
+       {
+         src_loc = pfile->cur_token[-1].src_loc;
+       }
 
-  if (_cpp_begin_message (pfile, level, src_loc, 0))
-    v_message (msgid, ap);
+      if (_cpp_begin_message (pfile, level, src_loc, 0))
+       v_message (msgid, ap);
+    }
 
   va_end (ap);
 }