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.
Posts by Lundin
Please no. I had a bad experience of SO's failed and cancelled "Documentation" project. I raised the same concerns on the Electronics site here. I'll quote that post: The worst that can happen is ...
It is a common mistake is to mix up the concepts of operator precedence and order of evaluation. Beginner classes and books often address the former in detail, but forget to mention the latter at a...
When doing something simple such as this int a=1; int b=2; int c=3; printf("%d\n", a + b * c); then I was told that operator precedence guarantees that the code is equivalent to a + (b * c)...
Please note that migrate in this context means grabbing the exact post as-is from a SE site and importing it here. This is allowed, with attribution given, as per licensing model. Codidact staff c...
So it appears that we've gotten our first "company tag", Apple. We know from SO that company name tags were always problematic since: Questions are about products, not companies. Given that the pr...
Some new tag "software practices" just popped up, no wiki. What's the purpose of this tag and how is it useful? What exactly in software development is not "software practices"? Seems quite superfl...
SIGSEGV is defined in the C header signal.h. To generate the signal, it should be sufficient to just do raise(SIGSEGV);. As far as I know, this is well-defined behavior.
These are fine, IMO: Here is my specification of what the program should do /--/. I'm stuck at x, (optionally: here is my code), where do I go from here? Is this implementation of x (code follows)...
"Stack vs heap" is a common over-simplification and not really a meaningful one, since those two areas have quite different, specialized uses. And no, those are not the only memory regions used by ...
I was told by my professor/book that computer programs use two kinds of memory and that all variables get allocated either on the stack or on the heap. Is this true? How can I tell where a variable...
Undefined behavior (informally "UB") is a formal term in the C language, defined in C17 3.4.3 undefined behavior behavior, upon use of a nonportable or erroneous program construct or of erroneous ...
I have created this sensational program: #include <stdio.h> int* func (void) { int local=5; return &local; } int main (void) { printf("%d\n", *func()); } This prints 5 even thoug...
The C standard does not speak of "errors" and "warnings", those are not formal terms. The compiler is only required to produce a diagnostic message, as specified in C11 5.1.1.3: Diagnostics A c...
What exactly must a C compiler do when it finds a compile-time error? The most obvious kind of errors are language syntax errors, but the C standard also speaks of constraints, which are rules tha...
The term escape sequence apparently dates back to the telegraph and pre-computer technology, according to wikipedia: https://en.wikipedia.org/wiki/Escape_sequence. So I doubt there's an universally...
Yes, it is generally good practice to always cast the return value of functions to (void) if not used. This is self-documenting code showing that you aren't using the return value on purpose and di...
EDIT: This discussion thread is mostly obsolete now that a new draft has been posted on the site. Please take further discussion & proposals to this meta post instead: Community feedback: What ...
Yes, the second line invokes undefined behavior. First of all, according to C17 6.5.2.1 regarding array subscripting, an expression E1[E2] is just "syntactic sugar" for *((E1)+(E2))). So what appli...