* support/cpp2/libcpp/directives.c, support/cpp2/libcpp/identifiers.c,
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 1 Jan 2007 17:00:18 +0000 (17:00 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 1 Jan 2007 17:00:18 +0000 (17:00 +0000)
  support/cpp2/libcpp/init.c, support/cpp2/libcpp/sdcpp-opts.c,
  support/cpp2/libcpp/sdcpp.c:
  sdcpp specific pragma/directive/option handling moved to sdcpp.c
* doc/sdccman.lyx: reference to the GCC 4.1.1 CPP Manual
* support/cpp2/libcpp/mkdeps.c: synchronized with GCC CPP 4.1.1

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4549 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
doc/sdccman.lyx
support/cpp2/libcpp/directives.c
support/cpp2/libcpp/identifiers.c
support/cpp2/libcpp/init.c
support/cpp2/libcpp/mkdeps.c
support/cpp2/sdcpp-opts.c
support/cpp2/sdcpp.c

index 73bb2c4081985da0f25d2230d9ea51224726eb6a..1bb517aa15bba79b0100f873affdf00ea5f0e309 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-01 Borut Razem <borut.razem AT siol.net>
+
+       * support/cpp2/libcpp/directives.c, support/cpp2/libcpp/identifiers.c,
+         support/cpp2/libcpp/init.c, support/cpp2/libcpp/sdcpp-opts.c,
+         support/cpp2/libcpp/sdcpp.c:
+         sdcpp specific pragma/directive/option handling moved to sdcpp.c
+       * doc/sdccman.lyx: reference to the GCC 4.1.1 CPP Manual
+       * support/cpp2/libcpp/mkdeps.c: synchronized with GCC CPP 4.1.1
+
 2006-12-31 Borut Razem <borut.razem AT siol.net>
 
        * SDCPP synchronized with GCC CPP release version 4.1.1,
 2006-12-31 Borut Razem <borut.razem AT siol.net>
 
        * SDCPP synchronized with GCC CPP release version 4.1.1,
index 86817c15dfbaaa6884ab018ba571741d414e4eb1..bc1c1cb994b01b913c45c1de646f6ffea3302595 100644 (file)
@@ -6192,7 +6192,7 @@ gcc
 \end_inset 
 
 ), if you need more dedicated options please refer to the GCC\SpecialChar ~
 \end_inset 
 
 ), if you need more dedicated options please refer to the GCC\SpecialChar ~
-3.3.6\SpecialChar ~
+4.1.1\SpecialChar ~
 CPP\SpecialChar ~
 Manual
  at 
 CPP\SpecialChar ~
 Manual
  at 
index 2602922913c466b8eb84e00d8ce7059671c206cb..2de65fbeaa348ec1a97f623e37923d32f3555094 100644 (file)
@@ -121,9 +121,6 @@ static void do_pragma_once (cpp_reader *);
 static void do_pragma_poison (cpp_reader *);
 static void do_pragma_system_header (cpp_reader *);
 static void do_pragma_dependency (cpp_reader *);
 static void do_pragma_poison (cpp_reader *);
 static void do_pragma_system_header (cpp_reader *);
 static void do_pragma_dependency (cpp_reader *);
-static void do_pragma_sdcc_hash (cpp_reader *pfile);
-static void do_pragma_preproc_asm (cpp_reader *pfile);
-static void do_pragma_pedantic_parse_number (cpp_reader *pfile);
 static void do_linemarker (cpp_reader *);
 static const cpp_token *get_token_no_padding (cpp_reader *);
 static const cpp_token *get__Pragma_string (cpp_reader *);
 static void do_linemarker (cpp_reader *);
 static const cpp_token *get_token_no_padding (cpp_reader *);
 static const cpp_token *get__Pragma_string (cpp_reader *);
@@ -1097,7 +1094,7 @@ register_pragma (cpp_reader *pfile, const char *space, const char *name,
       node = cpp_lookup (pfile, U space, strlen (space));
       entry = lookup_pragma_entry (*chain, node);
       if (!entry)
       node = cpp_lookup (pfile, U space, strlen (space));
       entry = lookup_pragma_entry (*chain, node);
       if (!entry)
-       entry = insert_pragma_entry (pfile, chain, node, NULL,
+       entry = insert_pragma_entry (pfile, chain, node, NULL, 
                                     allow_expansion, internal);
       else if (!entry->is_nspace)
        goto clash;
                                     allow_expansion, internal);
       else if (!entry->is_nspace)
        goto clash;
@@ -1121,7 +1118,7 @@ register_pragma (cpp_reader *pfile, const char *space, const char *name,
        cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name);
     }
   else
        cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name);
     }
   else
-    insert_pragma_entry (pfile, chain, node, handler, allow_expansion,
+    insert_pragma_entry (pfile, chain, node, handler, allow_expansion, 
                         internal);
 }
 
                         internal);
 }
 
@@ -1146,17 +1143,10 @@ _cpp_init_internal_pragmas (cpp_reader *pfile)
 
   /* New GCC-specific pragmas should be put in the GCC namespace.  */
   register_pragma (pfile, "GCC", "poison", do_pragma_poison, false, true);
 
   /* New GCC-specific pragmas should be put in the GCC namespace.  */
   register_pragma (pfile, "GCC", "poison", do_pragma_poison, false, true);
-  register_pragma (pfile, "GCC", "system_header", do_pragma_system_header,
+  register_pragma (pfile, "GCC", "system_header", do_pragma_system_header, 
                   false, true);
                   false, true);
-  register_pragma (pfile, "GCC", "dependency", do_pragma_dependency,
+  register_pragma (pfile, "GCC", "dependency", do_pragma_dependency, 
                   false, true);
                   false, true);
-
-  /* Kevin abuse for SDCC. */
-  cpp_register_pragma(pfile, 0, "sdcc_hash", do_pragma_sdcc_hash, false);
-  /* SDCC _asm specific */
-  cpp_register_pragma(pfile, 0, "preproc_asm", do_pragma_preproc_asm, false);
-  /* SDCC specific */
-  cpp_register_pragma(pfile, 0, "pedantic_parse_number", do_pragma_pedantic_parse_number, false);
 }
 
 /* Return the number of registered pragmas in PE.  */
 }
 
 /* Return the number of registered pragmas in PE.  */
@@ -1409,72 +1399,6 @@ do_pragma_poison (cpp_reader *pfile)
   pfile->state.poisoned_ok = 0;
 }
 
   pfile->state.poisoned_ok = 0;
 }
 
-/* SDCC specific
-   sdcc_hash pragma */
-static void
-do_pragma_sdcc_hash (cpp_reader *pfile)
-{
-    const cpp_token *tok = _cpp_lex_token (pfile);
-
-    if (tok->type == CPP_PLUS)
-    {
-       CPP_OPTION(pfile, allow_naked_hash)++;
-    }
-    else if (tok->type == CPP_MINUS)
-    {
-       CPP_OPTION(pfile, allow_naked_hash)--;
-    }
-    else
-    {
-       cpp_error (pfile, CPP_DL_ERROR,
-                  "invalid #pragma sdcc_hash directive, need '+' or '-'");
-    }
-}
-
-/* SDCC specific
-   pedantic_parse_number pragma */
-static void
-do_pragma_pedantic_parse_number (cpp_reader *pfile)
-{
-    const cpp_token *tok = _cpp_lex_token (pfile);
-
-  if (tok->type == CPP_PLUS)
-    {
-      CPP_OPTION(pfile, pedantic_parse_number)++;
-    }
-  else if (tok->type == CPP_MINUS)
-    {
-      CPP_OPTION(pfile, pedantic_parse_number)--;
-    }
-  else
-    {
-      cpp_error (pfile, CPP_DL_ERROR,
-                 "invalid #pragma pedantic_parse_number directive, need '+' or '-'");
-    }
-}
-
-/* SDCC _asm specific
-   switch _asm block preprocessing on / off */
-static void
-do_pragma_preproc_asm (cpp_reader *pfile)
-{
-  const cpp_token *tok = _cpp_lex_token (pfile);
-
-  if (tok->type == CPP_PLUS)
-    {
-      CPP_OPTION(pfile, preproc_asm)++;
-    }
-  else if (tok->type == CPP_MINUS)
-    {
-      CPP_OPTION(pfile, preproc_asm)--;
-    }
-  else
-    {
-      cpp_error (pfile, CPP_DL_ERROR,
-                "invalid #pragma preproc_asm directive, need '+' or '-'");
-    }
-}
-
 /* Mark the current header as a system header.  This will suppress
    some categories of warnings (notably those from -pedantic).  It is
    intended for use in system libraries that cannot be implemented in
 /* Mark the current header as a system header.  This will suppress
    some categories of warnings (notably those from -pedantic).  It is
    intended for use in system libraries that cannot be implemented in
index 18070b13c5074a9d1824f8529b5dedea3f81c954..c22f4a714bb558dc49965da9ea788855dc76c5b6 100644 (file)
@@ -73,8 +73,6 @@ _cpp_init_hashtable (cpp_reader *pfile, hash_table *table)
   s->n_false           = cpp_lookup (pfile, DSC("false"));
   s->n__VA_ARGS__       = cpp_lookup (pfile, DSC("__VA_ARGS__"));
   s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC;
   s->n_false           = cpp_lookup (pfile, DSC("false"));
   s->n__VA_ARGS__       = cpp_lookup (pfile, DSC("__VA_ARGS__"));
   s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC;
-  /* SDCC _asm specific */
-  s->n__asm             = cpp_lookup (pfile, DSC("_asm"));
 }
 
 /* Tear down the identifier hash table.  */
 }
 
 /* Tear down the identifier hash table.  */
index 726dafd6243e72b738d7b275927430447a49c88c..b05441153dd2be56deabe61734773c0b1c0f2ef6 100644 (file)
@@ -180,11 +180,6 @@ cpp_create_reader (enum c_lang lang, hash_table *table,
   /* Default the input character set to UTF-8.  */
   CPP_OPTION (pfile, input_charset) = _cpp_default_encoding ();
 
   /* Default the input character set to UTF-8.  */
   CPP_OPTION (pfile, input_charset) = _cpp_default_encoding ();
 
-  /* SDCC specific */
-  CPP_OPTION (pfile, preproc_asm) = 1;
-  CPP_OPTION (pfile, pedantic_parse_number) = 0;
-  CPP_OPTION (pfile, obj_ext) = NULL;
-
   /* A fake empty "directory" used as the starting point for files
      looked up without a search path.  Name cannot be '/' because we
      don't want to prepend anything at all to filenames using it.  All
   /* A fake empty "directory" used as the starting point for files
      looked up without a search path.  Name cannot be '/' because we
      don't want to prepend anything at all to filenames using it.  All
index 31feb826e6a32d3e99dc1ffa80726943273d800f..bf07c1babe668bba41b97782f6c2074291693fa6 100644 (file)
@@ -14,7 +14,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
 
 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
 
  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
@@ -36,6 +36,11 @@ struct deps
   const char **depv;
   unsigned int ndeps;
   unsigned int deps_size;
   const char **depv;
   unsigned int ndeps;
   unsigned int deps_size;
+
+  const char **vpathv;
+  size_t *vpathlv;
+  unsigned int nvpaths;
+  unsigned int vpaths_size;
 };
 
 static const char *munge (const char *);
 };
 
 static const char *munge (const char *);
@@ -79,7 +84,7 @@ munge (const char *filename)
     }
 
   /* Now we know how big to make the buffer.  */
     }
 
   /* Now we know how big to make the buffer.  */
-  buffer = xmalloc (len + 1);
+  buffer = XNEWVEC (char, len + 1);
 
   for (p = filename, dst = buffer; *p; p++, dst++)
     {
 
   for (p = filename, dst = buffer; *p; p++, dst++)
     {
@@ -106,24 +111,48 @@ munge (const char *filename)
   return buffer;
 }
 
   return buffer;
 }
 
-/* Public routines.  */
-
-struct deps *
-deps_init (void)
+/* If T begins with any of the partial pathnames listed in d->vpathv,
+   then advance T to point beyond that pathname.  */
+static const char *
+apply_vpath (struct deps *d, const char *t)
 {
 {
-  struct deps *d = xmalloc (sizeof (struct deps));
+  if (d->vpathv)
+    {
+      unsigned int i;
+      for (i = 0; i < d->nvpaths; i++)
+       {
+         if (!strncmp (d->vpathv[i], t, d->vpathlv[i]))
+           {
+             const char *p = t + d->vpathlv[i];
+             if (!IS_DIR_SEPARATOR (*p))
+               goto not_this_one;
+
+             /* Do not simplify $(vpath)/../whatever.  ??? Might not
+                be necessary. */
+             if (p[1] == '.' && p[2] == '.' && IS_DIR_SEPARATOR (p[3]))
+               goto not_this_one;
+
+             /* found a match */
+             t = t + d->vpathlv[i] + 1;
+             break;
+           }
+       not_this_one:;
+       }
+    }
 
 
-  /* Allocate space for the vectors only if we need it.  */
+  /* Remove leading ./ in any case.  */
+  while (t[0] == '.' && IS_DIR_SEPARATOR (t[1]))
+    t += 2;
 
 
-  d->targetv = 0;
-  d->depv = 0;
+  return t;
+}
 
 
-  d->ntargets = 0;
-  d->targets_size = 0;
-  d->ndeps = 0;
-  d->deps_size = 0;
+/* Public routines.  */
 
 
-  return d;
+struct deps *
+deps_init (void)
+{
+  return XCNEW (struct deps);
 }
 
 void
 }
 
 void
@@ -145,6 +174,14 @@ deps_free (struct deps *d)
       free (d->depv);
     }
 
       free (d->depv);
     }
 
+  if (d->vpathv)
+    {
+      for (i = 0; i < d->nvpaths; i++)
+       free ((void *) d->vpathv[i]);
+      free (d->vpathv);
+      free (d->vpathlv);
+    }
+
   free (d);
 }
 
   free (d);
 }
 
@@ -156,10 +193,10 @@ deps_add_target (struct deps *d, const char *t, int quote)
   if (d->ntargets == d->targets_size)
     {
       d->targets_size = d->targets_size * 2 + 4;
   if (d->ntargets == d->targets_size)
     {
       d->targets_size = d->targets_size * 2 + 4;
-      d->targetv = xrealloc (d->targetv,
-                            d->targets_size * sizeof (const char *));
+      d->targetv = XRESIZEVEC (const char *, d->targetv, d->targets_size);
     }
 
     }
 
+  t = apply_vpath (d, t);
   if (quote)
     t = munge (t);  /* Also makes permanent copy.  */
   else
   if (quote)
     t = munge (t);  /* Also makes permanent copy.  */
   else
@@ -220,16 +257,45 @@ deps_add_default_target (cpp_reader *pfile, const char *tgt)
 void
 deps_add_dep (struct deps *d, const char *t)
 {
 void
 deps_add_dep (struct deps *d, const char *t)
 {
-  t = munge (t);  /* Also makes permanent copy.  */
+  t = munge (apply_vpath (d, t));  /* Also makes permanent copy.  */
 
   if (d->ndeps == d->deps_size)
     {
       d->deps_size = d->deps_size * 2 + 8;
 
   if (d->ndeps == d->deps_size)
     {
       d->deps_size = d->deps_size * 2 + 8;
-      d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *));
+      d->depv = XRESIZEVEC (const char *, d->depv, d->deps_size);
     }
   d->depv[d->ndeps++] = t;
 }
 
     }
   d->depv[d->ndeps++] = t;
 }
 
+void
+deps_add_vpath (struct deps *d, const char *vpath)
+{
+  const char *elem, *p;
+  char *copy;
+  size_t len;
+
+  for (elem = vpath; *elem; elem = p)
+    {
+      for (p = elem; *p && *p != ':'; p++);
+      len = p - elem;
+      copy = XNEWVEC (char, len + 1);
+      memcpy (copy, elem, len);
+      copy[len] = '\0';
+      if (*p == ':')
+       p++;
+
+      if (d->nvpaths == d->vpaths_size)
+       {
+         d->vpaths_size = d->vpaths_size * 2 + 8;
+         d->vpathv = XRESIZEVEC (const char *, d->vpathv, d->vpaths_size);
+         d->vpathlv = XRESIZEVEC (size_t, d->vpathlv, d->vpaths_size);
+       }
+      d->vpathv[d->nvpaths] = copy;
+      d->vpathlv[d->nvpaths] = len;
+      d->nvpaths++;
+    }
+}
+
 void
 deps_write (const struct deps *d, FILE *fp, unsigned int colmax)
 {
 void
 deps_write (const struct deps *d, FILE *fp, unsigned int colmax)
 {
@@ -332,7 +398,7 @@ deps_restore (struct deps *deps, FILE *fd, const char *self)
   unsigned int i, count;
   size_t num_to_read;
   size_t buf_size = 512;
   unsigned int i, count;
   size_t num_to_read;
   size_t buf_size = 512;
-  char *buf = xmalloc (buf_size);
+  char *buf = XNEWVEC (char, buf_size);
 
   /* Number of dependences.  */
   if (fread (&count, 1, sizeof (count), fd) != sizeof (count))
 
   /* Number of dependences.  */
   if (fread (&count, 1, sizeof (count), fd) != sizeof (count))
@@ -347,7 +413,7 @@ deps_restore (struct deps *deps, FILE *fd, const char *self)
       if (buf_size < num_to_read + 1)
        {
          buf_size = num_to_read + 1 + 127;
       if (buf_size < num_to_read + 1)
        {
          buf_size = num_to_read + 1 + 127;
-         buf = xrealloc (buf, buf_size);
+         buf = XRESIZEVEC (char, buf, buf_size);
        }
       if (fread (buf, 1, num_to_read, fd) != num_to_read)
        return -1;
        }
       if (fread (buf, 1, num_to_read, fd) != num_to_read)
        return -1;
index 56d7439963faa1454833d41b912db4c8153e1b8d..506a4867fe52bbe22dacdc6e4363c9278a74adc5 100644 (file)
@@ -598,7 +598,7 @@ sdcpp_common_post_options (const char **pfilename)
   return 1;
 }
 
   return 1;
 }
 
-/* Front end initialization common to C, ObjC and C++.  */
+/* Front end initialization. */
 bool
 sdcpp_common_init (void)
 {
 bool
 sdcpp_common_init (void)
 {
index 794879efd5faa6fcccc288c7997321edcbfb15b4..c594eb8aa25b718f06b2da1c9b3e8ccd6e74baeb 100644 (file)
@@ -53,7 +53,7 @@ const char *progname;         /* Needs to be global.  */
 }
 
 /* From c-lang.c */
 }
 
 /* From c-lang.c */
-#define LANG_HOOKS_INIT_OPTIONS sdcpp_common_init_options
+#define LANG_HOOKS_INIT_OPTIONS sdcpp_init_options
 #define LANG_HOOKS_INITIALIZE_DIAGNOSTICS sdcpp_initialize_diagnostics
 #define LANG_HOOKS_HANDLE_OPTION sdcpp_common_handle_option
 #define LANG_HOOKS_MISSING_ARGUMENT sdcpp_common_missing_argument
 #define LANG_HOOKS_INITIALIZE_DIAGNOSTICS sdcpp_initialize_diagnostics
 #define LANG_HOOKS_HANDLE_OPTION sdcpp_common_handle_option
 #define LANG_HOOKS_MISSING_ARGUMENT sdcpp_common_missing_argument
@@ -62,6 +62,7 @@ const char *progname;         /* Needs to be global.  */
 #define LANG_HOOKS_FINISH sdcpp_common_finish
 #define LANG_HOOKS_PRINT_ERROR_FUNCTION sdcpp_print_error_function
 
 #define LANG_HOOKS_FINISH sdcpp_common_finish
 #define LANG_HOOKS_PRINT_ERROR_FUNCTION sdcpp_print_error_function
 
+static unsigned int sdcpp_init_options (unsigned int argc, const char **argv);
 static void sdcpp_initialize_diagnostics (diagnostic_context *context);
 static void sdcpp_print_error_function (diagnostic_context *context, const char *file);
 
 static void sdcpp_initialize_diagnostics (diagnostic_context *context);
 static void sdcpp_print_error_function (diagnostic_context *context, const char *file);
 
@@ -174,6 +175,96 @@ get_src_pwd (void)
    return src_pwd;
 }
 
    return src_pwd;
 }
 
+/* SDCPP specific pragmas */
+/* SDCC specific
+   sdcc_hash pragma */
+static void
+do_pragma_sdcc_hash (cpp_reader *pfile)
+{
+    const cpp_token *tok = _cpp_lex_token (pfile);
+
+    if (tok->type == CPP_PLUS)
+    {
+       CPP_OPTION(pfile, allow_naked_hash)++;
+    }
+    else if (tok->type == CPP_MINUS)
+    {
+       CPP_OPTION(pfile, allow_naked_hash)--;
+    }
+    else
+    {
+       cpp_error (pfile, CPP_DL_ERROR,
+                  "invalid #pragma sdcc_hash directive, need '+' or '-'");
+    }
+}
+
+/* SDCC specific
+   pedantic_parse_number pragma */
+static void
+do_pragma_pedantic_parse_number (cpp_reader *pfile)
+{
+    const cpp_token *tok = _cpp_lex_token (pfile);
+
+  if (tok->type == CPP_PLUS)
+    {
+      CPP_OPTION(pfile, pedantic_parse_number)++;
+    }
+  else if (tok->type == CPP_MINUS)
+    {
+      CPP_OPTION(pfile, pedantic_parse_number)--;
+    }
+  else
+    {
+      cpp_error (pfile, CPP_DL_ERROR,
+                 "invalid #pragma pedantic_parse_number directive, need '+' or '-'");
+    }
+}
+
+/* SDCC _asm specific
+   switch _asm block preprocessing on / off */
+static void
+do_pragma_preproc_asm (cpp_reader *pfile)
+{
+  const cpp_token *tok = _cpp_lex_token (pfile);
+
+  if (tok->type == CPP_PLUS)
+    {
+      CPP_OPTION(pfile, preproc_asm)++;
+    }
+  else if (tok->type == CPP_MINUS)
+    {
+      CPP_OPTION(pfile, preproc_asm)--;
+    }
+  else
+    {
+      cpp_error (pfile, CPP_DL_ERROR,
+                "invalid #pragma preproc_asm directive, need '+' or '-'");
+    }
+}
+
+/* SDCPP specific option initialization */
+static unsigned int
+sdcpp_init_options (unsigned int argc, const char **argv)
+{
+  unsigned int ret = sdcpp_common_init_options(argc, argv);
+
+  CPP_OPTION (parse_in, preproc_asm) = 1;
+  CPP_OPTION (parse_in, pedantic_parse_number) = 0;
+  CPP_OPTION (parse_in, obj_ext) = NULL;
+
+  /* Kevin abuse for SDCC. */
+  cpp_register_pragma(parse_in, 0, "sdcc_hash", do_pragma_sdcc_hash, false);
+  /* SDCC _asm specific */
+  cpp_register_pragma(parse_in, 0, "preproc_asm", do_pragma_preproc_asm, false);
+  /* SDCC specific */
+  cpp_register_pragma(parse_in, 0, "pedantic_parse_number", do_pragma_pedantic_parse_number, false);
+
+  /* SDCC _asm specific */
+  parse_in->spec_nodes.n__asm = cpp_lookup (parse_in, DSC("_asm"));
+
+  return ret;
+}
+
 static void
 sdcpp_initialize_diagnostics (diagnostic_context *context)
 {
 static void
 sdcpp_initialize_diagnostics (diagnostic_context *context)
 {