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 Hyperlynx‭

Type On... Excerpt Status Date
Comment Post #292535 The `-Wswitch` business is a red herring. The real issue is that - assuming you have a switch statement that does satisfy all the cases in the `enum` - MSVC does not consider that enough to satisfy 4715 while Clang does consider it enough to satisfy `-Werror=return-type`
(more)
3 months ago
Comment Post #292535 That said, >This is because both of them treat the code as if it isn't prepared for an invalid enum value, because reasons. This isn't necessarily incorrect, imho. It's not unlikely that someone might cast an `int` to an `enum`, which does introduce the possibility of the enum having a value th...
(more)
3 months ago
Comment Post #292535 Interesting. - We're already using `-Wswitch`, the problem is that nothing triggers for Clang when all of the enum's cases are accounted for in the `switch`. - `std::abort` can be used in place of `std::unreachable` as well. I've used it as part of my work-in-progress patch in some areas. - CI ...
(more)
3 months ago
Edit Post #292529 Initial revision 3 months ago
Question How can I get the same "not all control paths return a value" behaviour across Clang and MSVC?
I've recently discovered that it's not actually an error to have control reach the end of a non-void function without returning anything, it's merely undefined behaviour. I want to promote the relevant warning(s) to error. Our product that's built on multiple platforms, using Clang on one and Micr...
(more)
3 months ago
Edit Post #291404 Initial revision 7 months ago
Question Can I conditionally include class members without using #ifdef?
`#ifdef` sections can, of course, be used to include or exclude chunks of code based on some criteria known at compile time. One big problem is that when the condition is evaluated to `false`, the chunk is not only excluded from the compiled code but the compiler skips right over it altogether. This ...
(more)
7 months ago
Edit Post #285566 Initial revision almost 3 years ago
Question Continuously read from piped input using Vim
In Vim, it's possible to tell it to read from stdin instead of a file, by using `vim -`. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facing is that Vim seems to wait until the pipe is closed before starting up and displaying anything. It ...
(more)
almost 3 years ago
Edit Post #284256 Post edited:
about 3 years ago
Comment Post #284256 Oh, right, that. True.
(more)
about 3 years ago
Edit Post #284256 Initial revision about 3 years ago
Answer A: What are the disadvantages of using static methods in Java?
> I think I can access the static method without caring of class, isn't it? No. A static method is still a class method, and you still care about the class. The difference is that static methods aren't used with an instance of a class (an object). > static method can helps to decrease amount of...
(more)
about 3 years ago
Comment Post #284243 I'm not sure about that. It looks to me like this is a basic "what on earth does `static` mean?" question.
(more)
about 3 years ago
Edit Post #284171 Initial revision over 3 years ago
Answer A: Is it a good idea to have a permanent branch for a feature?
I wouldn't. Not unless you intend to keep developing on every branch independently! Presumably you're not doing that. In that case, I think it makes your intent clearer to just use a tag to mark the version, then delete the branch. If you ever find that you do need to go back and make some changes...
(more)
over 3 years ago
Comment Post #282485 The fact that you're trying to make a constructor isn't relevant to the fact that you're trying to pass a pointer to character array to something that expects a pointer to a `struct Book`.
(more)
over 3 years ago
Comment Post #282466 What's strange about it? The important thing is that `char* function` is *not* a string! It's just a pointer to a character. In C, a string is just a block of characters. You need to actually point your character pointer to such a block, or else it doesn't point anywhere. elgonzo's reply uses a...
(more)
over 3 years ago
Comment Post #282083 It can't be `fruitProgram` itself leaking. When a process is terminated and closed, the OS itself frees the memory it used. Leaks only persist until a process terminates, unless the OS itself actually has a leak (extraordinarily unlikely). I'll give `communicate` a go, but the wording at https://d...
(more)
over 3 years ago
Edit Post #282083 Post edited:
over 3 years ago
Edit Post #282083 Initial revision over 3 years ago
Question Freeing sub-process resources?
I'm using Python to invoke another program in a sub-process. I've noticed my memory sometimes gets so large as to crash the system, and I'm wondering if I'm not correctly cleaning up the memory somehow. Here's what I have: ``` children = [] fruits = ["apple", "banana", "cherry"] for frui...
(more)
over 3 years ago
Comment Post #280868 The question is when it's in a `namespace`, not a `class`.
(more)
almost 4 years ago
Comment Post #280868 Well... that's basically just duplicating my question, really. I did state that enums don't get their own pages, and that my classes have their own pages where it lists at the bottom what files they came from.
(more)
almost 4 years ago
Comment Post #280767 I must be honest, I didn't actually follow through the threads of execution myself to see which specific lines are or aren't legal. I just cut straight to "yes, it is legal to run a method in an object that has been deleted", which is what the question appears to be asking overall, and is true in all...
(more)
almost 4 years ago
Edit Post #280776 Initial revision almost 4 years ago
Answer A: Is it correct to run code inside a method whose object has been destroyed?
Yes, it's correct. An object's methods aren't things that exist in memory with the object. They're in a completely separate section of memory, and a method exists exactly once regardless of whether you have one object, a million objects or zero objects. You can even go so far as to `delete this...
(more)
almost 4 years ago
Comment Post #280694 I wonder if there isn't some ESL thing going on here? A "demand" is absolutely not something one makes of a volunteer, under any circumstances.
(more)
almost 4 years ago
Comment Post #279879 The project files do get set up to re-invoke CMake before they run, though. It's not often you actually have to re-run CMake yourself.
(more)
almost 4 years ago
Comment Post #279879 Well, think about what the alternative is: managing the .sln or .xcodeproj or Makefile yourself. You run CMake to generate/update those files. If you're only on one platform you could dispense with CMake altogether and instead just include those project files in the repo directly. Unless your spec...
(more)
almost 4 years ago
Comment Post #278296 It's just an example, dude. That's not relevant to the question.
(more)
almost 4 years ago
Comment Post #278299 Can you elaborate? Why is it bad practice?
(more)
almost 4 years ago
Edit Post #279879 Post edited:
about 4 years ago
Edit Post #279879 Post edited:
about 4 years ago
Edit Post #279879 Initial revision about 4 years ago
Answer A: How to do "out-of-source" build properly with cmake?
Whenever I've worked with CMake-based projects, the structure has been something like this: project src <-------- typically this is a source control working directory CMakeLists.txt project1.cpp project2.cpp libA libA.cmake libA1.cpp libA2....
(more)
about 4 years ago
Edit Post #279878 Initial revision about 4 years ago
Question List what file(s) an identifier was declared in?
I'm using Doxygen to help me figure out some library code. There's an `enum` I know I need to use, but I don't know which file it's declared in. Searching for that identifier in Doxygen yields the page for the whole namespace in which it is declared. If I click on it in the summary at the top of t...
(more)
about 4 years ago
Comment Post #279252 Besides which, if your attitude is "editing commits is altering history, which is always wrong and is forbidden" then Git probably isn't the tool for you.
(more)
about 4 years ago
Comment Post #279252 As for your value judgement about how we use Git, that's absolutely just your opinion. I could say the same for how you evidently use Git, since you're apparently using it like it's SVN and not getting the full benefit of the tool you have. Read the link I posted. Or don't, since this is irrelevant t...
(more)
about 4 years ago
Comment Post #279252 It makes it hard to follow the thread of conversation if you're going to reply by editing your answer, rather than not here. You have misunderstood, or I have expressed myself poorly. I am editing commits *which have not been pushed*. That's a statement of fact! I am working on a local branch, edi...
(more)
about 4 years ago
Comment Post #279304 Perfect! I didn't even know git had its own alias system, either. It doesn't deal with interactive rebasing, but I can insert it into the rebase TODO.
(more)
about 4 years ago
Comment Post #279072 There's more than one way of using git well. I'm very happy to hear that your way works for you, and that you're always able to check in intermediate commits that do not break the build and are also changes that are meaningful to the rest of the team. My question was whether this is possible, and if ...
(more)
about 4 years ago
Comment Post #279252 I have no power to change our workflow. Furthermore, I'm not changing history, I haven't altered anything that has been pushed. I'm changing the commits that I'm authoring, before pushing them to the shared repo. This isn't Subversion, where Every Revision Is Sacred. What you're saying is like saying...
(more)
about 4 years ago
Edit Post #279070 Post edited:
Tried to clarify the scenario
about 4 years ago
Comment Post #279070 @Moshi or, if my patch is sitting in peer review, and minor changes are requested before I push, those changes are made by amending the proposed patch. Nobody wants or needs to see each tiny change in the log, they want to see the final version as one change. Without `--reset-author`, the date in the...
(more)
about 4 years ago
Comment Post #279070 @Moshi The date that I submit my final, cleaned-up, "good copy" commit, with its helpful commit message is what is useful. The past commits do not exist any more, they are scratch-pad workings out - the date of the first one of those is not useful.
(more)
about 4 years ago
Comment Post #279070 @Moshi I'm not trying to remove the date, I'm trying to reset it to the current date. That's what `--reset-author` does. I want that behaviour by default, when I do a `commit --amend` or a squash. I mistakenly thought `--date=` also did that, when in fact it doesn't work at all.
(more)
about 4 years ago
Comment Post #279072 The issue here is that squashing and amending uses the timestamp of the original commit, not what you're squashing into it. The rest is irrelevant to the topic at hand.
(more)
about 4 years ago
Comment Post #279072 You've completely missed my point. Nobody in my team pushes commits like that. The way I (and presumably my colleagues) work is to make a topic branch, let's say for ticket 932. I then commit whenever I need to save my progress, eg because I'm about to try a new approach and don't want to lose my...
(more)
about 4 years ago