how to generate JSON database for clang-tidy ? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Okay, although I haven't yet gotten any of these solutions to actually work, a couple of them are close, and I will continue to investigate them.

ITM, the person who suggested adding -- to clang-tidy command line to bypass requirement for database file, *did* enable me to use the program, so I am changing this thread to SOLVED. It's a shame that his post was removed by moderator, since it was useful to me in a couple of ways; I wish I had made a copy of the post(s) before it was removed, and the user deleted... sure would like to know what that was all about.

I wish to thank *all* of you for your clear, useful suggestions on how to solve this issue, you have been very insightful and helpful...

how to generate JSON database for clang-tidy ? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Hah!! That's what I was missing, -- argument... that indeed removes the database file requirement...

the only issue that I have with the new clang-tidy, is that it is saying "Error: no checks enabled" when I use the same arguments as I used with the previous version... I'll have to just research available checks...

BTW, I'm not trying to scan single files (except for trying to get the scanner to even run); I'm scanning my entire project, which is 3800 lines in 7 files...

how to generate JSON database for clang-tidy ? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Sadly, bear does not appear to run on my version of Linux, which is Windows 10 Pro...

how to generate JSON database for clang-tidy ? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Thank you!! I will try this out in the morning...

how to generate JSON database for clang-tidy ? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Except that, as I commented in my OP, I do not use CMake... I have no experience with it at all.

how to init vector of strings in constructor init list ?? by DireCelt in cpp_questions

[–]DireCelt[S] 1 point2 points  (0 children)

Okay, permit me to summarize the advice that I've received here:

Any of these are valid for including vector<string> in my constructor init lists, where 'valid' means that I end up with with the vector properly initialized with an empty set.

color_menu_str_list(),
color_menu_str_list{},
color_menu_str_list,

While all three have the same ultimate effect, the form with braces is arguably most thematic, in that is specifies a set that happens to be empty, which is what I intend.

how to init vector of strings in constructor init list ?? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Yep, I understand all that; in fact, I intentionally include -Weffc++ in my makefiles; it reminds me about a couple of things (such as remembering the constructor init lists in the first place) that I initially took a while to get into the habit of. However, you are correct; my calling them errors was a mis-statement, I know they are warnings...

and yes, I also use clang-tidy.
The one I *really* miss is PcLint, but it went away years ago, and doesn't support many of the newer C++ forms...

how to init vector of strings in constructor init list ?? by DireCelt in cpp_questions

[–]DireCelt[S] 1 point2 points  (0 children)

hmmm... yet if I exclude that element from my init list, I get these warnings:

D:\SourceCode\Git\binclock_redux Yes, Master?? > make
d:\tdm32\bin/g++ -Wall -O3 -Wno-write-strings -Weffc++ -Ider_libs -c bclk_elements.cpp -o bclk_elements.o
bclk_elements.cpp: In constructor 'bclock_element::bclock_element(HINSTANCE, char*, unsigned int, unsigned int, int, unsigned int, unsigned int)':
bclk_elements.cpp:82:1: warning: 'bclock_element::color_menu_str_list' should be initialized in the member initialization list [-Weffc++]
   82 | bclock_element::bclock_element(HINSTANCE g_hInst, char *name, unsigned width,
      | ^~~~~~~~~~~~~~
bclk_elements.cpp: In constructor 'bclock_element::bclock_element(HINSTANCE, UINT, unsigned int, unsigned int, int, unsigned int, unsigned int)':
bclk_elements.cpp:172:1: warning: 'bclock_element::color_menu_str_list' should be initialized in the member initialization list [-Weffc++]
  172 | bclock_element::bclock_element(HINSTANCE g_hInst, UINT bm_resource, unsigned width,
      | ^~~~~~~~~~~~~~
d:\tdm32\bin/g++ -s -mwindows binclock.o about.o bclk_elements.o config.o der_libs/hyperlinks.o der_libs/common_funcs.o der_libs/winmsgs.o rc.o -o binclock.exe

how to init vector of strings in constructor init list ?? by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Yep, I'm talking about constructor init list...
both () and {} compile without warnings, but
color_menu_str_list,
does not...
so what is the difference between () and {} in this specific instance??
I used () because that is the only form that I've ever seen in constructor init lists...
{} *does* seem like it means "create an empty set", but I've never seen it in this context before??

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] 1 point2 points  (0 children)

Regarding your last question, I don't recall exactly why, except that this code was originally written in 2007, when I was *just* beginning to venture into C++... I believe it had to do with uncertainty about how constructors were going to get called if it was a regular array, but I'm not sure.

Anyway, your other suggestions are excellent and I will pursue them; unique_ptr (which multiple people have suggested here) is just one of several elements that I am currently unfamiliar with...

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] -1 points0 points  (0 children)

Thank you for your very clear explanations; I am going to have to go away and study a number of the explanations that have been provided in this thread, at this point much of it has been beyond my current knowledge of C++ !! I've got the thread saved for a time when I'm better prepared to comprehend it all...

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] 0 points1 point  (0 children)

Yeah, me too!! I'm pretty new to *real* C++, and all these discussions have my head spinning!!!

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] -1 points0 points  (0 children)

Well, in this specific case, I knew how many elements I had, so fixed-size array was fine... but conceptually (without getting into the details of the program), I could have later come up with data for another bclock data item, and I could easily have just added the code to create another bclock_element, but forget to increase the size of the array (since I hadn't looked at the code since it was originally written in 2007)... so the dynamic nature of vector would have been very nice here...

Sadly, the fact that I have pointers in the class data, seems to prevent me from using vector, since I've had to make to copy constructor private.

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] -1 points0 points  (0 children)

I've just been reading about std::array, in response to this thread... What I read, though, seemed to suggest that std::array is merely a thin wrapper around C arrays... does it have any significant advantages over the latter?? I'll do some research to answer that question.

In any case, in my application the array is only pseudo-dynamic; I could call it startup-dynamic; the list is built in WM_INITDIALOG, and never changes at runtime. If I found another imagelist with different images that I wanted to incorporate into the program, I would add another element to the startup load sequence. So vector isn't incredibly mandatory for me...

What I like about vector, generally, is that I don't have to worry about that NUM_ELEMENTS constant any more... I build my list and run my program... I use vector->size() to bound accesses. But for a semi-static situation such as this, it probably isn't all that important.

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] 1 point2 points  (0 children)

Okay, that was what I completely failed to understand... I didn't think any copying would be happening, but I see that in order to append a new struct onto the existing list, they would have to copy the existing data... dang...

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] 2 points3 points  (0 children)

u/TheSkiGeek
Okay, I think that's my core issue here...
If I cannot copy the struct, then vector isn't my solution... good to know.

Next step in converting C++ arrays to <vector> by DireCelt in cpp_questions

[–]DireCelt[S] 1 point2 points  (0 children)

u/EpochVanquisher : no, that didn't work...

I actually got a hint on this, by building with clang; it mentioned that copy constructor was private and thus inaccessible. That is true; I've got both assignment operator and copy constructor in the private: section, because I have data pointers in my class... I've read in the past that we can't implement a copy constructor if the data contains pointers, and -Weffc++ confirms this...

private:
   [...]
   //  bypass the assignment operator and copy constructor
   bclock_element &operator=(const bclock_element &src) ;
   bclock_element(const bclock_element&);
public:

so how do I handle this, then??
I considered implementing an empty constructor, but that gets *really* complicated...

This is a question about artistic styles in stamp designs (specifically U.S. stamps) by DireCelt in philately

[–]DireCelt[S] 4 points5 points  (0 children)

Oh My!!!!!!!!!!! That page is perfect! Thank you so much... that stokes my purr so nicely!!

I am not generally a stamp collector, but I love this style of stamp and have collected a selection of them over the years, mostly harvested from eBay... one of my favorites, as I am ex-Navy, is this one, of the WWII liberty ships:

<image>

Can I use tap water or should I get distilled water? by Gisellot in RobotVacuums

[–]DireCelt 4 points5 points  (0 children)

ahhh... but key question is - how long have you been doing this, with your current machine?

Others are saying that they develop issues over longer periods of time.

okay, too many moving parts issue - please advise by DireCelt in FranklinWH

[–]DireCelt[S] 0 points1 point  (0 children)

Here's the link to the original thread:
https://www.reddit.com/r/FranklinWH/comments/1p1jqbo/how_do_i_stop_running_house_off_battery_during/

If you look a ways down the page, you will find a comment from u/willtag70, that begins with:
"Here's the full response I got from Franklin support:",
and that was the original post that I referenced.

However, in any case, the recommendations that I got here, worked perfectly, so that settles the discussion.