Comments (4)
Hmm, GitHub doesn't allow me to attach the notmuch.h file for your convenience --- or I am too dumb. So I uploaded it to 0x0.st instead. Here is the link: http://0x0.st/o-If.h
The weird filename is from the pastebin site 0x0.st, not from me.
from c2nim.
I'm getting the same issue but seems to only happen when running on a header in a directory owned by root eg all the headers in /usr/include
.
Seems to be an issue with c2nim
trying to create the output in a directory owned by root. Running c2nim
with a copy of the header in a directory owned by my local user or specifying --out:output.nim
seems to work.
I guess there's missing error check when opening the output file which causes the seg fault. Would be better to exit with a useful error instead.
from c2nim.
I am facing this problem with the header in a directory not owned by root. In my case, it occurs with file:
https://github.com/FFmpeg/FFmpeg/blob/release/6.1/libavformat/avformat.h
I use ffmpeg.c2nim
:
#ifdef C2NIM
#def av_const
#def av_always_inline
#def av_pure
#pp AV_HAVE_BIGENDIAN
#def attribute_deprecated
#def av_warn_unused_result
#def AV_PIX_FMT_NE
#endif
#def FF_API_R_FRAME_RATE TRUE
#ifdef C2NIM
#@
template AV_PIX_FMT_NE*(be, le: untyped):untyped =
`AV_PIX_FMT le`
@#
#endif
If I use the following command:
c2nim --strict --skipinclude --dynlib:libavformat --header --skipcomments --out:avformat/avformat.nim ffmpeg.c2nim ../FFmpeg-release-6.1/libavformat/avformat.h
it complains about line 2831:
FFmpeg-release-6.1/libavformat/avformat.h(2831, 1) Error: did not expect #
If execute the same line without --strict
:
[warning] preprocessor ignoring option: endif
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[1] 4858 segmentation fault (core dumped) c2nim --skipinclude --dynlib:libavformat --header --skipcomments ffmpeg.c2ni
from c2nim.
In my case, it looks like the issue is related with trying to create output file in an unexisting folder.
So by just doing:
mkdir avformat
the problem was solved.
from c2nim.
Related Issues (20)
- Type after enum identifier not parsed in C++
- Unused imports and other warnings
- A failing construct will fail an entire statement list within an if directive.
- Infinite loop / memory leak
- Computer freeze: c2nim on Linux, translating AnsiC header file HOT 8
- c2nim chokes on static arrays in parameters
- fails to parse `typedef struct` with ifdef inside
- fails to recognise stdint types HOT 2
- invalid code generated for `extern const` HOT 2
- `importc` not generated for typedef
- generated `proc` types should be `raises: []`
- c2nim fails to remove "LL" suffixes on types
- Mark generated enums with `size: sizeof(cint)`
- Translate __attribute__ tags
- typedef struct { ... } xx [error bug?] because have #ifdef ... #endif before
- Cant generate: gl3.h have 183KB out of range
- C `enum` should not be translated to Nim enum
- Implicit Forward Declared Struct incorrectly Converted HOT 1
- Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2nim.