Thread: Use highest warning level recommended?

  1. #16
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by christop View Post
    The warnings about casting to void* in printf statements are not ignorable. Passing in the wrong pointer type (i.e., not a void pointer) has undefined behavior. Some architectures even have different sizes of pointers depending on the pointed-to type. The safest thing to do is cast the pointers to void*.
    That seems dumb but again, they ARE ignorable on projects that are NOT meant to go into the wild or even be used in other projects, sure there are special cases but on the average developer's computer it is not a concern, anyways the point of the file was to help me understand zlib compression in a localised environment, it was never intended to be run out in the wild, I provided access to the code so that people who were inclined to help me where able to access the info they wanted to know without waiting around for me to respond, I could even misunderstand what they're on about so it is easier to just provide the full source where I can do so.

  2. #17
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,733
    Quote Originally Posted by hamster_nz View Post
    Back in the old days (of 16-bit IBM PCs) you had "near pointers" "far pointers" and "huge pointers".

    'near' pointers were 16 bits, and could address up to 64k, but only in one block of memory - usually in the data or code segments.

    'far' pointers were 32-bits, but could address 64k anywhere in 1MB of memory

    'huge' pointers were 32-bits, very inefficient, but could address anywhere in 1MB of memory.

    C compilers would compile almost anything without warnings, as they had to run on CPUs that might be 4.77MHz, and fit into only a few hundred kb of RAM.

    Programmers learnt fast or died young back then. Ah, the good old days...

    Explain Near Far Huge pointers in C language
    If I or someone else where programming on or for that sort of computer then sure, the extra warnings above would be errors at that point, but when it's intended for the average computer addressing scheme then it's ignorable, you wouldn't expect AAA games like FFXV to be designed for such computers would you? Likewise you shouldn't expect a small project for learning something to be designed for such an environment either. Sure I plan to port the code to my *.png handler and at that time I will take such things into consideration (assuming I even need to since those printf statements won't be in the final code), but for local environment learning those warnings are normally ignorable.

  3. #18
    Registered User I C everything's Avatar
    Join Date
    Apr 2019
    Posts
    101
    Quote Originally Posted by hamster_nz View Post
    Back in the old days (of 16-bit IBM PCs) you had "near pointers" "far pointers" and "huge pointers".

    'near' pointers were 16 bits, and could address up to 64k, but only in one block of memory - usually in the data or code segments.

    'far' pointers were 32-bits, but could address 64k anywhere in 1MB of memory

    C compilers would compile almost anything without warnings, as they had to run on CPUs that might be 4.77MHz, and fit into only a few hundred kb of RAM.
    PCjr had only 64k RAM
    I done some retrocoding,isnt it accessible 1mb+ almost one more 64k block?
    extra annoying thing that cause bugs,segment switching and suddenly your variables you intend to use is in a different segment,breaking the code
    you tell me you can C,why dont you C your own bugs?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Switching between user-level and kernel-level threads
    By Javed Iqbal in forum Tech Board
    Replies: 9
    Last Post: 12-16-2014, 09:16 AM
  2. Warning Level
    By C_ntua in forum C# Programming
    Replies: 6
    Last Post: 07-13-2010, 07:02 AM
  3. Recommended C#/.NET Book
    By kuphryn in forum C# Programming
    Replies: 4
    Last Post: 04-23-2004, 09:21 AM
  4. Recommended reading?
    By Brian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-19-2003, 06:34 PM
  5. any C Compilers recommended ??
    By imbecile in C in forum C Programming
    Replies: 10
    Last Post: 06-25-2003, 02:16 PM

Tags for this Thread