unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: Matthew Wette <mwette@alumni.caltech.edu>
Cc: guile-user@gnu.org
Subject: [bug nyacc] C99 parser crashes on #warning
Date: Sat, 08 Jun 2024 09:27:21 +0200	[thread overview]
Message-ID: <878qzfuc6e.fsf@gnu.org> (raw)

Hi!

Using the file warning.c:

--8<---------------cut here---------------start------------->8---
// warning.c
#warning warn me!
#warning oops
--8<---------------cut here---------------end--------------->8---

Nyacc's c99 parser crashes on (right after) the first #warning

--8<---------------cut here---------------start------------->8---
$ guile 
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,use (nyacc lang c99 parser)
scheme@(guile-user)> ,use (nyacc version)
scheme@(guile-user)> *nyacc-version*
$1 = "1.09.4"
scheme@(guile-user)> (with-input-from-file "warning.c" parse-c99)
warning: warn me!
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure car: Wrong type argument in position 1 (expecting pair): #<unspecified>

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In ice-9/ports.scm:
   433:17  9 (call-with-input-file _ _ #:binary _ #:encoding _ #:guess-encoding _)
    472:4  8 (_ _)
In nyacc/lang/c99/parser.scm:
    784:6  7 (parse-c99 _ #:cpp-defs _ #:inc-dirs _ #:inc-help _ #:mode _ #:xdef? _ # _ # _ …)
In ice-9/boot-9.scm:
  1747:15  6 (with-exception-handler #<procedure 7fa866593180 at ice-9/boot-9.scm:1831:7 (…> …)
  1747:15  5 (with-exception-handler #<procedure 7fa866593150 at ice-9/boot-9.scm:1831:7 (…> …)
In nyacc/lang/c99/parser.scm:
   787:33  4 (_)
In nyacc/parse.scm:
   169:37  3 (_ #<procedure 7fa8665a3ee0 at nyacc/lang/c99/parser.scm:376:8 ()> #:debug _)
In nyacc/lang/c99/parser.scm:
   697:27  2 (_)
   594:29  1 (read-token)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)
scheme@(guile-user) [1]> 
--8<---------------cut here---------------end--------------->8---

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com



             reply	other threads:[~2024-06-08  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08  7:27 Janneke Nieuwenhuizen [this message]
2024-06-08 14:14 ` [bug nyacc] C99 parser crashes on #warning Matt Wette
2024-06-08 20:50   ` Janneke Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878qzfuc6e.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=mwette@alumni.caltech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).