Search:

Type: Posts; User: awsdert

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    0
    Views
    7

    Quick check for potential problems

    While I'm waiting on a response in another thread I'll quickly ask if anyone sees any potential problems with this freshly made code:


    int alu_mov( alu_t *alu, uintptr_t num, uintptr_t val,...
  2. Replies
    4
    Views
    120

    By that I assume you mean when under a target,...

    By that I assume you mean when under a target, this is supposed to be executed BEFORE any targets, or am I mistaken? Here's a slightly larger snippet:


    COMPILE_EXE=$(CC) $(BIN_FLAGS) $1 $(COP)o...
  3. Replies
    4
    Views
    120

    Made another mistake that I can't identify, this...

    Made another mistake that I can't identify, this seemed an appropriate thread to tack it onto instead of creating another thread.
    This:


    $(info $(call rebase,$(FBSTDC_DIR)))
    $(shell $(call...
  4. Replies
    4
    Views
    120

    Never mind, just spotted my mistake, I had...

    Never mind, just spotted my mistake, I had renamed the files but forgot to change it in code
  5. Replies
    4
    Views
    120

    I can't spot my mistake...

    I'll start with the output


    make rebuild
    MAKECMDGOALS=rebuild
    make -f main.mak rebuild
    make[1]: Entering directory '~/alu'
    PRJ_SRC_FILES = 'test.c alu_bit.c alu_main.c alu_math.c alu_mem.c...
  6. Replies
    7
    Views
    148

    To be honest I kinda wanna try compiling under...

    To be honest I kinda wanna try compiling under the K&C compiler at a later date so anything I might have to define is something I wanna make sure has a fallback definition, I also wanna try passing...
  7. Replies
    7
    Views
    148

    An example of defines that should both be in...

    An example of defines that should both be in limits.h but not always is the LONG_LONG_* and LLONG_*, I'm certain I read somewhere that at one point it was only LONG_LONG_*, there's also the kernel...
  8. Replies
    7
    Views
    148

    From my experience it certainly always has been...

    From my experience it certainly always has been unsigned, to my knowledge ssize_t was supposed to resolve the need for a signed version. flp1969, do you happen to know of a scenario where it is...
  9. Replies
    7
    Views
    148

    Fallbacks and suggestions

    Mostly done with fallbacks for defines that should be in limits.h (now switched to checking for a define called NO_STDC when including them directly is unwanted)

    Begun work on fbstdint.h (started...
  10. Replies
    20
    Views
    358

    If you take a closer look at those defines you'll...

    If you take a closer look at those defines you'll notice I already programmed around that (was actually just trying to silence the compiler warnings but it's still suitable for that scenario), as I...
  11. Replies
    20
    Views
    358

    You assume that a compiler would follow the C...

    You assume that a compiler would follow the C standard to the letter in the scenario that the processor's word size is smaller than needed to support that size, don't forget that char has always been...
  12. Replies
    20
    Views
    358

    Oh really? You might wanna read this article...

    Oh really? You might wanna read this article then:
    Word (computer architecture) - Wikipedia
  13. Replies
    20
    Views
    358

    Not from my experience Precisely why I'm...

    Not from my experience


    Precisely why I'm trying to program this around the worst case scenario where nothing is available
  14. Replies
    20
    Views
    358

    Which works in runtime but not compile time, say...

    Which works in runtime but not compile time, say you wanna wrap around stddef.h, stdint.h && intypes.h and then make sure everything is defined in the scenario none of them are available (such as the...
  15. Replies
    20
    Views
    358

    True, but that's runtime, I'm trying to make...

    True, but that's runtime, I'm trying to make compile time constants
  16. Replies
    20
    Views
    358

    As far as calculating CHAR_BIT this is the best I...

    As far as calculating CHAR_BIT this is the best I got, lemme know if you see problems with it:


    #ifndef CHAR_BIT
    #if ~0 << 8
    #define CHAR_BIT 8
    #elif ~0 << 7
    #define CHAR_BIT 7
    #elif ~0 << 6...
  17. Replies
    20
    Views
    358

    Well limits.h doesn't always define the size...

    Well limits.h doesn't always define the size and/or width of an integer, much less the preprocessor integer size/width (used integral since I remember a compiler - vc I think - defining some macro...
  18. Replies
    20
    Views
    358

    Never mind, just thought of a solution: ...

    Never mind, just thought of a solution:


    #define MAX_FOR_SIZE(PRV) \
    (((PRV) >= ~0u) ? ~0u : (((PRV) * (PRV)) + (PRV) + (PRV)))
  19. Replies
    20
    Views
    358

    How to silence integer overflow warning

    Managed to get a working macro that can calculate the size of an integer type based on the unsigned max given (up to supported size anyway), the problem I'm having is silencing the preprocessor...
  20. Replies
    1
    Views
    145

    ...well this is embarrassing, I made a silly...

    ...well this is embarrassing, I made a silly mistake when I duplicated code for the test, while I did change the operators that was all I changed, turned out I forgot to change which function is...
  21. Replies
    1
    Views
    145

    Bugs in quickly made code

    Would've stuck this in a previous thread but I think my previous post there will be ignored for sure if I do that so separate thread it is, made some bitwise math for my bignum code but results came...
  22. Replies
    35
    Views
    530

    Judging by what I read on a stack overflow thread...

    Judging by what I read on a stack overflow thread it seems unsuitable for this situation since while it's not recommended to use internal functions of a library there are use case scenarios, for...
  23. Replies
    35
    Views
    530

    I tried adding that static to single function in...

    I tried adding that static to single function in the header, compiler complained it was undefined then so I #if 0'd the original and copied it's code to the header, compiler is now saying it's unused...
  24. Replies
    35
    Views
    530

    Turned out the problem was this very function,...

    Turned out the problem was this very function, where this:

    pos.B = 1u << pos.p should've been this:
    pos.B = 1llu << pos.p or with my newly made macro, this:
    pos.B = ALU_SEG_C(1) << pos.p
    After...
  25. Replies
    35
    Views
    530

    What REG->upto, REG->last & REG->init hold ...

    What REG->upto, REG->last & REG->init hold


    typedef struct alu_bit {
    size_t s, b, p; alu_seg_t *S, B;
    } alu_bit_t;

    s represents segment number (used as (alu_seg_t*)(REG->part) + s)
    b...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4