Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for Melkor-1‭

Type On... Excerpt Status Date
Comment Post #289415 C23 has added new format specifiers for exact-width integer types, least-width integer types, et cetera. For instance, `%w32d` for `uint32_t`, `%w64d` for `uint64_t` et cetera, which means that we can say goodbye to the `PRI*` macros. I believe the documentation for `fprintf()` would have this inform...
(more)
5 months ago
Comment Post #291888 I am unaware which tags to use. Could a moderator help me with them?
(more)
5 months ago
Edit Post #291888 Initial revision 5 months ago
Question Managing a dependency for a C application
One of my applications has a dependency on a stb-library. Now I am publishing this application to Github. Should I: Include the header that was used during development with the code? Have an install.sh script (for UNIX and UNIX-like operating systems) that would wget the header during installati...
(more)
5 months ago
Comment Post #291854 @#8176 I forgot to add the function declaration of `foo`. I have now.
(more)
5 months ago
Edit Post #291854 Post edited:
5 months ago
Edit Post #291854 Post edited:
5 months ago
Edit Post #291854 Post edited:
5 months ago
Edit Post #291854 Initial revision 5 months ago
Question Are these two function pointer declarations equivalent?
Say I have two functions: ```c FILE getinput(const char fname[static 1]); FILE getoutput(const char fname[static 1]); ``` And I wish to declare a function pointer and assign it the result of some processing which shall be called later. Are these two declarations: ```c int foo(FILE ,...
(more)
5 months ago
Comment Post #291705 How do you suggest formatting `200819` in `#define _POSIX_C_SOURCE 200819`?
(more)
5 months ago
Comment Post #291805 There is no platform independent function copy files in ISO C Standard or ISO POSIX Standard. There's the usual `open()` + `read()` + `write()` + `fstat()` + `fchmod()` method, which is portable, but requires all bytes to be dragged to userspace. And it also has 5 syscalls instead of 1-2.
(more)
5 months ago
Edit Post #291805 Post undeleted 5 months ago
Edit Post #291805 Post deleted 5 months ago
Comment Post #291805 @#8176 Making backup/temp files during saving files in a text editor is the current use-case.
(more)
5 months ago
Edit Post #291805 Post edited:
5 months ago
Comment Post #291805 @#64656 Better now?
(more)
5 months ago
Edit Post #291805 Post edited:
5 months ago
Edit Post #291805 Post edited:
5 months ago
Edit Post #291805 Post edited:
5 months ago
Edit Post #291805 Initial revision 5 months ago
Question What's the fastest way to copy, preserving file attributes, on each platform?
I am looking copy files platform-dependently on Linux, Oracle Solaris, MacOS, BSDs, and Windows. I have found some system calls for each platform, namely `sendfile()`, `copyfilerange()`, `fcopyfile()`, `CopyFile()` et cetera. But some of them are documented to copy file attributes, whilst some are...
(more)
5 months ago
Edit Post #291460 Post edited:
6 months ago
Edit Post #291460 Initial revision 6 months ago
Question Testing an opaque type's internals
First: What is an opaque pointer in C? Now when it comes to testing such a type, I know of 3 ways: 1. Include the source file (the one containing the definition of the type and the functions that work with it) directory into the test source file. (This is the easiest, but often discouraged with...
(more)
6 months ago
Edit Post #291343 Post edited:
7 months ago
Edit Post #291343 Post undeleted 7 months ago
Edit Post #291343 Post edited:
7 months ago
Edit Post #291343 Post deleted 7 months ago
Edit Post #291343 Post edited:
7 months ago
Edit Post #291343 Post edited:
7 months ago
Edit Post #291343 Post edited:
7 months ago
Edit Post #291343 Initial revision 7 months ago
Question Github workflow for a C application
This is my first try at automating building and testing some C code for these platforms: Linux Windows MacOS OpenBSD (arm64 and x86-64) FreeBSD (arm64 and x86-64) NetBSD Oracle Solaris OmniOS It just builds and runs the tests with make: ```yaml name: Arena Tests on: [wor...
(more)
7 months ago
Comment Post #291199 Is there any benefit of defining MEMPOOL_SIZE and MEMPOOL_ALIGN in the header?
(more)
8 months ago
Edit Post #290971 Post edited:
8 months ago
Edit Post #290971 Post edited:
9 months ago
Edit Post #290971 Post edited:
9 months ago
Edit Post #290971 Initial revision 9 months ago
Question A small header-only input output library
The library (inspired by stb libraries) attempts to provide some commonly used functions (reading a file into memory, determining the size of a file) that are missing from the C standard library portably (for my own use cases). Code: ```c #ifndef IOH #define IOH #include #include #includ...
(more)
9 months ago
Comment Post #290878 About mixing indentation styles, I was following [K&R](https://en.wikipedia.org/wiki/Indentation_style#K&R_style), where *each function has its opening brace at the next line*.
(more)
9 months ago
Comment Post #290878 What functions would you suggest moving to a separate file?
(more)
9 months ago
Edit Post #290857 Post edited:
9 months ago
Edit Post #290857 Initial revision 9 months ago
Question Trie Implementation, Graph Visualization and Auto-Completion in C
Given a list of strings (say a text file containing some C symbols: c-symbols.txt), the program can: 1) Generate a graph of the underlying trie (-p/--prefix can be specified to inspect a specific prefix subtree) with Graphviz dot: ```bash » time ./trie --prefix at --svg c-symbols.txt ./t...
(more)
9 months ago