Thread: HyperC

  1. #61
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,006
    Quote Originally Posted by Structure View Post
    This is how i see it.
    So this means that you want HyperC to retain the notion of undefined behaviour. This means that the responsibility is on you to define HyperC rigorously, because whatever you miss out in this regard is undefined behaviour.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #62
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    102
    This means that the responsibility is on you to define HyperC rigorously
    If you program with HyperC and you cause an error how is that my fault ?

    If HyperC is the cause of the error i will fix it.

    FYI rigorous is an understatement for my coding techniques.
    Last edited by Structure; 13 Hours Ago at 02:27 PM.


  3. #63
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    102
    Im still confused about the difference between undefined behavior and a mistake.

    you want HyperC to retain the notion of undefined behaviour.
    There should be some sort of structure and rules i think.
    Last edited by Structure; 13 Hours Ago at 02:39 PM.


  4. #64
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,006
    Quote Originally Posted by Structure View Post
    If you program with HyperC and you cause an error how is that my fault ?
    It isn't!

    Quote Originally Posted by Structure
    FYI rigorous is an understatement for my coding techniques.
    You forgot to check the return value of fgets when providing an example in the C programming forum recently

    But anyway, I'm talking about rigour of language specification, not code.

    Quote Originally Posted by Structure
    Im still confused about the difference between undefined behavior and a mistake.
    Consider a common programming mistake:
    Code:
    int numbers[10];
    for (int i = 0; i <= 10; ++i)
        numbers[i] = i;
    In C, this results in undefined behaviour: the compiler is free to produce a program that does practically anything on that out of bounds assignment to numbers[10]. In other programming languages, this error might be well defined, e.g., perhaps the wrong assignment would cause an exception to be thrown, and this is guaranteed to happen.

    Here's another common beginner's question in C:
    Code:
    int x = 0;
    printf("%d\n", x++ + x++);
    What's the output? In C, the answer is that the behaviour is undefined, so this is actually a mistake because of how sequence points/sequenced before/after work in C. In languages that don't have the notion of undefined behaviour, they might define it, so this would not be a mistake... or they might explicitly say that such use is an error, and hence require the compiler to reject the code with an error.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #65
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    102

    Cool HyperC tips...

    Importing shaders:
    Code:
    <c static const char* vertex_shader_source = ":$>shaders/vertex.glsl;";
    <c static const char* fragment_shader_source = ":$>shaders/fragment.glsl;";


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HyperC Pre Process File Injection
    By Structure in forum Tech Board
    Replies: 2
    Last Post: 08-06-2019, 06:13 AM
  2. The future of the C language is HyperC
    By Structure in forum Projects and Job Recruitment
    Replies: 6
    Last Post: 05-14-2019, 08:55 AM

Tags for this Thread