/*
-See
-http://src.openresources.com/debian/src/devel/HTML/S/altgcc_2.7.2.2.orig%20altgcc-2.7.2.2.orig%20protoize.c.html
-static char *
-abspath (cwd, rel_filename)
-
-*/
-
-/*!!!!
-*** cpplib.c.old Tue Nov 28 2000 09:04:09 AM
---- cpplib.c Tue Nov 28 2000 08:55:18 AM
-***************
-*** 5715,5722 ****
- c2 = cppReader_peekC (pfile)
- if (c2 != '\n'
- goto randomchar
-! token = CPP_HSPACE
-! goto op2any
---- 5714,5723 ----
- case '\\'
- c2 = cppReader_peekC (pfile)
- if (c2 != '\n'
- goto randomchar
-! cppReader_forward (pfile, 1)
-! pfile->lineno++
-! return CPP_HSPACE
-
-
- case '\n'
- cppReader_putChar (pfile, c)
-
-
-Carl J. Appellof ( mailto:cappello@legato.com <mailto:cappello@legato.com> )
-*/ /*@i8@*/
-
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2002 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
**
** For information on lclint: lclint-request@cs.virginia.edu
** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
+** For more information: http://www.splint.org
*/
/*
** cpplib.c
{ 4, do_line, "line", T_LINE, TRUE, FALSE, FALSE },
{ 5, do_ident, "ident", T_IDENT, TRUE, FALSE, TRUE },
/* { 8, do_unassert, "unassert", T_UNASSERT, TRUE, FALSE, FALSE }, */
- { -1, 0, "", T_UNUSED, FALSE, FALSE, FALSE },
+ { -1, NULL, "", T_UNUSED, FALSE, FALSE, FALSE },
};
/*@noaccess cstring@*/
else if (cppReader_peekC (pfile) == '/'
&& CPPOPTIONS (pfile)->cplusplus_comments)
{
+
+ (void) cppoptgenerror
+ (FLG_SLASHSLASHCOMMENT,
+ message ("C++ style // comment"
+ ),
+ pfile);
+
cppReader_forward (pfile, 1);
for (;;)
exp_p--;
SKIP_WHITE_SPACE (p);
if (p == limit || ! is_idstart[(int) *p]
- || (*p == 'L' && p + 1 < limit && (p[1] == '\'' || p[1] == '"')))
+ || (*p == 'L' && p + 1 < limit && (p[1] == '\'' || p[1] == '\"')))
cppReader_errorLit (pfile,
cstring_makeLiteralTemp ("`#' operator is not followed by a macro argument name"));
else
id_len = p - id_beg;
if (is_idstart[(int) c]
- && ! (id_len == 1 && c == 'L' && (*p == '\'' || *p == '"'))) {
+ && ! (id_len == 1 && c == 'L' && (*p == '\'' || *p == '\"'))) {
register struct arglist *arg;
for (arg = arglist; arg != NULL; arg = arg->next) {
SKIP_WHITE_SPACE (bp);
} else {
switch (*bp) {
- case '!': case '"': case '#': case '%': case '&': case '\'':
+ case '!': case '\"': case '#': case '%': case '&': case '\'':
case ')': case '*': case '+': case ',': case '-': case '.':
case '/': case ':': case ';': case '<': case '=': case '>':
case '?': case '[': case '\\': case ']': case '^': case '{':
sym_length = size_fromInt (p - symname);
if (sym_length == 0
- || (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
+ || (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '\"')))
cppReader_error (pfile, message ("invalid %s name", usage));
else if (!is_idstart[(int) *symname])
{
if (!is_idstart[(int) *ip->cur])
goto oops;
- if (ip->cur[0] == 'L' && (ip->cur[1] == '\'' || ip->cur[1] == '"'))
+ if (ip->cur[0] == 'L' && (ip->cur[1] == '\'' || ip->cur[1] == '\"'))
goto oops;
if ((hp = cppReader_lookup (ip->cur, -1, -1)) != 0)
if (!fileTable_exists (context_fileTable (),
cstring_fromChars (filename)))
{
- (void) fileTable_addHeaderFile (context_fileTable (),
+ if (fileloc_isXHFile (g_currentloc))
+ {
+ /*
+ ** Files includes by XH files are also XH files
+ */
+
+ (void) fileTable_addXHFile (context_fileTable (),
cstring_fromChars (filename));
+ }
+ else
+ {
+ (void) fileTable_addHeaderFile (context_fileTable (),
+ cstring_fromChars (filename));
+ }
}
else
{