mainnyacc parser generator - Support: sr #109622, "eval-c99-cx: missed...

 
 

sr #109622: "eval-c99-cx: missed comp-lit" error on raylib.h

Submitter:  Yuriy Al. Shirokov <yashrk>
Submitted:  Tue 15 Jan 2019 07:48:47 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  mwette
Open/Closed:  Closed Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Jan 2019 03:58:09 PM UTC, comment #7: 

Yes, thank you again!

(BTW, warnings indeed was related to wrong permissions of files  ~/.cache/guile and wasn't related to an issue.)

Yuriy Al. Shirokov <yashrk>
Fri 18 Jan 2019 03:49:33 PM UTC, comment #6: 

I have released nyacc-0.90.2 which incorporates this fix.
I will close

Matt Wette <mwette>
Group administrator
Thu 17 Jan 2019 01:32:38 PM UTC, comment #5: 

As for the warnings about not being able to generate a path for the auto-compiled file, I can't reproduce that.  I wonder if somehow some directory in your ~/.cache/guile/... is owned by root.

Matt Wette <mwette>
Group administrator
Wed 16 Jan 2019 02:21:04 PM UTC, comment #4: 

I applied this patch to the rel-0.90 branch and the module was created successfully, I even can create a Raylib window.

More complex code segfaults (for example, LoadModel() function; probably, it's because of the wrong return type size — there are list of 4 floats where the Matrix type, an structure of 16 floats, is in C code), but it's obviously an another issue.

But complex macros are not breaking nyacc now, thank you for fixing it so fast!

Yuriy Al. Shirokov <yashrk>
Wed 16 Jan 2019 01:37:34 PM UTC, comment #3: 

uploaded patch1 which is against release 0.90.
It changed behavior to be able to generate raylib.scm:

mwette$ guild compile-ffi raylib.ffi
compiling `raylib.ffi' ...ffi-help: unable to generate constant for "SubText"
ffi-help: unable to generate constant for "FormatText"
ffi-help: unable to generate constant for "RAYWHITE"
ffi-help: unable to generate constant for "MAGENTA"
ffi-help: unable to generate constant for "BLANK"
ffi-help: unable to generate constant for "BLACK"
ffi-help: unable to generate constant for "WHITE"
ffi-help: unable to generate constant for "DARKBROWN"
ffi-help: unable to generate constant for "BROWN"
ffi-help: unable to generate constant for "BEIGE"
ffi-help: unable to generate constant for "DARKPURPLE"
ffi-help: unable to generate constant for "VIOLET"
ffi-help: unable to generate constant for "PURPLE"
ffi-help: unable to generate constant for "DARKBLUE"
ffi-help: unable to generate constant for "BLUE"
ffi-help: unable to generate constant for "SKYBLUE"
ffi-help: unable to generate constant for "DARKGREEN"
ffi-help: unable to generate constant for "LIME"
ffi-help: unable to generate constant for "GREEN"
ffi-help: unable to generate constant for "MAROON"
ffi-help: unable to generate constant for "RED"
ffi-help: unable to generate constant for "PINK"
ffi-help: unable to generate constant for "ORANGE"
ffi-help: unable to generate constant for "GOLD"
ffi-help: unable to generate constant for "YELLOW"
ffi-help: unable to generate constant for "DARKGRAY"
ffi-help: unable to generate constant for "GRAY"
ffi-help: unable to generate constant for "LIGHTGRAY"
ffi-help: unable to generate constant for "RAD2DEG"
ffi-help: unable to generate constant for "DEG2RAD"
ffi-help: unable to generate constant for "PI"
 wrote `raylib.scm'
compiling `raylib.scm' ... wrote `/home/mwette/.cache/guile/ccache/2.2-LE-8-3.A/home/mwette/repo/sv/misc/raylib.scm.go'

Matt Wette <mwette>
Group administrator
Wed 16 Jan 2019 08:03:38 AM UTC, comment #2: 

Thank you! Please notify me about any related commits.

Yuriy Al. Shirokov <yashrk>
Wed 16 Jan 2019 01:22:28 AM UTC, comment #1: 

Thanks for the update.

As for the WARNINGS that looks like maybe not a bug, but result of not compiling the installed sources.  I will check with the devel email list.

Now for the error.  That is something I can work on but it may be tricky to fix.  My immediate reaction will be to have the FH fail for that case but complete the conversion of the module.  Then you would have to add the cases by hand.   These could be done by using something like
("LIGHTGRAY" . (make-Color 200 200 200 255))
I will think about it.

Matt Wette <mwette>
Group administrator
Tue 15 Jan 2019 07:48:47 AM UTC, original submission:  

Trying to create bindings for Raylib (https://github.com/raysan5/raylib). FFI file:


(define-ffi-module (ffi raylib)
  #:pkg-config "raylib"
  #:include '("raylib.h"))


Command output:

$ guild compile-ffi ffi/raylib.ffi
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /usr/share/guile/site/2.2/scripts/compile-ffi.scm
;;; WARNING: compilation of /usr/share/guile/site/2.2/scripts/compile-ffi.scm failed:
;;; failed to create path for auto-compiled file "/usr/share/guile/site/2.2/scripts/compile-ffi.scm"
;;; compiling /usr/share/guile/site/2.2/nyacc/lang/c99/ffi-help.scm
;;; WARNING: compilation of /usr/share/guile/site/2.2/nyacc/lang/c99/ffi-help.scm failed:
;;; failed to create path for auto-compiled file "/usr/share/guile/site/2.2/nyacc/lang/c99/ffi-help.scm"
compiling `ffi/raylib.ffi' ...missed:
(comp-lit
  (type-name
    (decl-spec-list (type-spec (typename "Color"))))
  (initzer-list
    (initzer (p-expr (fixed "245")))
    (initzer (p-expr (fixed "245")))
    (initzer (p-expr (fixed "245")))
    (initzer (p-expr (fixed "255")))))
ERROR: In procedure scm-error:
eval-c99-cx: missed comp-lit


Cairo bindings on the same machine were created successfully (with similar warnings).

Yuriy Al. Shirokov <yashrk>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #45987:  patch1 added by mwette (6KiB - application/octet-stream - patch1 : comp-lit changed from fatal error to skipped definition)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mwette (Updated the item)
  • -email is unavailable- added by yashrk (Submitted the item)
  • -email is unavailable- added by yashrk
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-15 mwette Open/ClosedOpen Closed
    2019-01-18 mwette StatusIn Progress Done
    2019-01-16 mwette Attached File- Added patch1, #45987
    2019-01-16 mwette StatusNone In Progress
        Assigned toNone mwette
    2019-01-15 yashrk Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code