[CLOSED] : Compiler bug with template parameter = void* - page 12

 
fxsaber:

Developers. As it is with OrderSend, for example.

Here is an example https://www.mql5.com/ru/forum/295485/page11#comment_9959761

I thought they would get tired of answering the same question and finally issue a warning - no, they didn't

So MQL is not for traders, but for programmers

Баг компилятора при параметре шаблона = void*
Баг компилятора при параметре шаблона = void*
  • 2018.12.20
  • www.mql5.com
Ошибка компилятора. Билд 1961, 64 бит...
 
A100:

It is sufficient to disable number-based warnings (you can't see them through the MetaEditor, but they are there), which I do through the command compiler

Can you tell me how to do this?
 
Alexey Navoykov:
Can you tell me how this is done?

The compilation results are output to a file and from there the lines with no number of known warning numbers are extracted (after the word warning there is a number)

 
A100:

The results of the compilation are output to a file and from there the lines that do not have any pre-defined warning numbers are extracted (the word warning is followed by a number)

So how do I make these warnings not appear in ME? Where do I put these numbers?
 
Alexey Navoykov:
So how do I make these warnings not appear in ME? Where do I put these numbers?

I compile at the command line and all the messages are also displayed at the command line. It cannot be attached to the MetaEditor IDE. This is the final, so to say, compilation - checking for important warnings. I don't even look at warnings in the IDE anymore - there are too many of them

 
A100:

So MQL is not for traders, but for programmers

Not being a programmer, I use MQL. Finish that mantra about programmers. I think I know MQL better than the average user and perhaps a freelancer.

So I can reasonably say that I understand the problems faced by most users of the language.

 
A100:

I compile on the command line and all messages are also output on the command line. It cannot be attached to MetaEditor IDE. This is the final compilation - check for important warnings

Well, it's not interesting... By the way, why do you compile at the command line?
 
Alexey Navoykov:
Ah, that's not interesting... By the way, why do you compile on the command line?

Say a new build is out and / or I need to recompile all and or only certain files - I set a list and only the list is compiled / several lists

Or do I need to recompile in another build - I set the build number and list and the command file does it all by itself

 
A100:

And what's the point of such a value, if you get only 4 bytes out of 8. Given that the Developers explicitly prohibited to convert the value of a pointer to ulong (before you could, and believe me high bits were non-zero at that time).

It has been experimentally shown that this number behaves exactly as a pointer index in an array of pointers would behave if such an array assigned numbers to pointers strictly consecutively and, if a range of numbers was freed, reused them from the last freed number to the first in reverse order. If someone wanted to duplicate this system of descriptors in their architecture, e.g. replacing a pointer type with a structure of size int, understandable behaviour (return true as inline type for a destroyed object, while this behaviour prohibits overloading a number of useful logical operators with pointers, this is a complete facepalm) and all the benefits of simple type, while maintaining tight control over the population of objects and pointers via counter, the ability to get this number from the object itself would save a significant amount of pa

And speaking of more mundane tasks - this number indicates the number of objects created in the system and is useful for debugging in any architecture based on dynamic lists. Not surprisingly, I'm not the first who figured out how to "cheat" the prohibition on getting it, and I've even been told a faster way, though only for 4.
 
A100:

For example, a new build came out and / or I need to recompile all or only certain files

I see, but this is a special case. After all, we spend most of our time coding and compiling in the IDE, so disabling unnecessary warnings there would be very handy.

I personally find a lot of unnecessary things there. For instance, there are warnings on implicit conversion to string. I cannot recall cases when it might cause some unpleasant consequences. 99% of cases string is used only for printing text on the screen or writing it into a file.

Or, suppose, when the type of the function's return value is bool, and you return 0 or 1, the compiler will complain too, saying that the type is not boolean. VS doesn't have it. These constants are permissible for bool. For instance, I'm more convenient to write return 0 rather than return false because it's much easier to visually perceive.

So, my log is almost completely packed with just these two warnings. I'd like to get rid of them ).

When I'll get around to it, maybe I will finish it myself. I have a lot of ideas there. For now I just made automatic scrolling of log after finishing compilation to the beginning of the first error (if any). Without it I had to manually scroll the list (and it's pretty big), looking for error message. What a pain in the ass.