#struct code triggers Bitdefender

5 messages · Page 1 of 1 (latest)

meager tiger
#

The following code in CodeBlocks triggers Bitdefender virus alarm and it deletes the Debug bin folder and I don't understand why.
The code compiles and runs but the windows shell is empty.
Also, if I print only p1 or only p2, it runs smoothly, as soon as I try to run both, the AV triggers and deletes the bin.

typedef struct
{
int x, y;
}Point;

int main()
{

Point p1={2, 5};
Point p2= {.x= 2, .y= 5};

printf("x= %d\n", p1.x);
printf("y= %d\n", p1.y);

printf("x= %d\n", p2.x);
printf("y= %d\n", p2.y);

}

dire hazelBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

lunar holly
# meager tiger The following code in CodeBlocks triggers Bitdefender virus alarm and it deletes...

I assume Bitdefender is an anti-virus program.
Besides the fact that an anti-virus program is completely unnecessary nowadays, what happens is that BitDefender sees that you want to execute a program from which it doesn't know the origin (because you just wrote it and didn't put any trustworthy signature there) and so it does what it thinks is best by preventing that code from actually executing.
You should be able to set exceptions or change the blocking behaviour in general in your BitDefender settings (or you just uninstall it entirely).

Maybe it's something else, but that would be my primary theory.

meager tiger
#

Bitdefender is indeed an anti-virus program, which I'd rather keep, since i'm still not quite familiar with how viruses work😅
I am intrigued to find out why you think they are unnecessary though, i'm gonna dig into that.

The weird thing with my code is that the anti-virus only triggers if I compile when both Point p1 and Point p2 are in the code. If I delete or comment either of them, it runs just fine.

lunar holly
#

I am intrigued to find out why you think they are unnecessary though, i'm gonna dig into that.
Cause Windows Defender is easily good enough, if not better. Also an anti-virus program can be an actual threat because it has so many privileges and thereby creating a new entry point for hackers.

only triggers if I compile when both [Points] are in the code.
bing_shrug