Search:

Type: Posts; User: rstanley

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Thread: A memory leak

    by rstanley
    Replies
    12
    Views
    2,546

    You are not being "Old Fashioned"! Just stick to...

    You are not being "Old Fashioned"! Just stick to using the Standard C Library and your code will be very portable. Avoid most, if not all of the compiler specific extension functions!


    C is for...
  2. Thread: A memory leak

    by rstanley
    Replies
    12
    Views
    2,546

    Actually, there is one minor correction I would...

    Actually, there is one minor correction I would make besides the my other reccmendations:

    printf("%u is not betweem 1 and %u.\n", count, MAXNUMS);

    // Should be:

    printf("%u is not betweem 1...
  3. Thread: A memory leak

    by rstanley
    Replies
    12
    Views
    2,546

    BillMcEnaney: IMHO, No. splint is...

    BillMcEnaney:



    IMHO, No.

    splint is outdated and has too many "False Positives". Apparently it has not been updated since 2007, prior to the C11 and C17 C Standards were published!
    ...
  4. Replies
    6
    Views
    2,144

    strcat() is a C Standard Library...

    strcat() is a C Standard Library function. As such, the prototype for this and all other C Standard Library functions, will be the same on Windows, Linux, UNIX, MacOS, and all other Standards...
  5. Replies
    6
    Views
    2,144

    Please make sure that you post code that will...

    Please make sure that you post code that will compile on someone else's computer!

    "EMPTY;" should be replaced with a simple standard, ';' Everyone knows what that means!

    $is_null(dst) Not...
  6. Thread: A memory leak

    by rstanley
    Replies
    12
    Views
    2,546

    If you are capturing the output from output...

    If you are capturing the output from output functions just to prevent messages from splint, don't waste your time! use:

    splint -retvalint ./source_file.c

    You should be checking the return...
  7. Thread: A memory leak

    by rstanley
    Replies
    12
    Views
    2,546

    Your "memory leak" is erroneous! If you are on...

    Your "memory leak" is erroneous! If you are on Linux, you could run valgrind. Splint is not that reliable, IMHO. I consider splint report of a memory leak as a false positive.

    I would also...
  8. Replies
    6
    Views
    2,144

    Yes, it is possible. If you are talking...

    Yes, it is possible.

    If you are talking about defining your version of strcat(), how would you approach it? If you didn't use pointers how would you write it? How would you then implement it...
  9. Replies
    6
    Views
    2,144

    Seriously? strcat() does use pointers to both...

    Seriously? strcat() does use pointers to both the source and destination! In a browser enter, "https://man7.org/linux/man-pages/man3/strcat.3p.html" and read the details presented there!
    ...
  10. Replies
    4
    Views
    2,641

    Did you "#include " that declares the...

    Did you "#include <stdio.h>" that declares the function, fileno().
  11. MIPS cross compile...

    MIPS cross compile with gcc.

    I don't use MIPS.
  12. Simple: $ gcc -S divide.c // divide.s ...

    Simple:


    $ gcc -S divide.c

    // divide.s

    .file "divide.c"
    .text
    .globl divide
  13. Replies
    13
    Views
    4,578

    You should have all the information you need to...

    You should have all the information you need to answer these questions. Visit your library and borrow a good book on the C Programming language, if you don't want to buy one.

    Look at the...
  14. Replies
    13
    Views
    4,578

    "const" and "volatile" are NOT data types! ...

    "const" and "volatile" are NOT data types!

    The keyword volatile should not be used, especially for a beginning programmer, that has not studied a good book on the C Language!

    const prevents a...
  15. Replies
    13
    Views
    4,578

    #include int uvar; //...

    #include <stdio.h>

    int uvar; // Unitialized global variable, stored in the bss data segment
    int ivar = 10; // Initialized global variable, stored in the global data segment...
  16. Replies
    13
    Views
    4,578

    That article is pretty clear, what is not clear...

    That article is pretty clear, what is not clear for you?

    All static variables, both local and global, along with all global variables are located in the data segments. Static local variables are...
  17. Replies
    27
    Views
    8,381

    I would avoid assembler code completely and see...

    I would avoid assembler code completely and see if the article I gave you has a better solution for your needs.
    IMHO!
  18. Replies
    27
    Views
    8,381

    I am away from my computer for the rest of the...

    I am away from my computer for the rest of the day. Perhaps someone else can assist you further.
  19. Replies
    27
    Views
    8,381

    Take a look at this page: Use compiler flags for...

    Take a look at this page: Use compiler flags for stack protection in GCC and Clang | Red Hat Developer
  20. Replies
    27
    Views
    8,381

    That is your job! I can't do all the work for...

    That is your job! I can't do all the work for you! ;^)
  21. Replies
    27
    Views
    8,381

    You should be able to view the stack through a...

    You should be able to view the stack through a debugger such as gdb. Check the documentation for gdb.
  22. Replies
    27
    Views
    8,381

    I have never done any stack tracking, using the...

    I have never done any stack tracking, using the current program stack, though there may be a way to do it.

    As for converting code to assembly, you can do it with "gcc -S hello.c". You can...
  23. Replies
    27
    Views
    8,381

    If you are so concerned about blowing the stack...

    If you are so concerned about blowing the stack using recursion, then change the algorithm to avoid recursion. Don't try to track the stack!

    Adding function calls within the recursive function...
  24. Replies
    2
    Views
    2,445

    This would seem to be a compiler/O/S...

    This would seem to be a compiler/O/S implementation problem. Under Debian Linux, I see no difference, using gcc on the command line, with or without initialization, and should not see any...
  25. There is no way for a poster to delete a post. ...

    There is no way for a poster to delete a post. On the contrary, it helps other readers who might have similar issues, or just use the post to further their knowledge of the C Language.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4