Giter VIP home page Giter VIP logo

Comments (4)

nuft avatar nuft commented on September 16, 2024

2.: I added the missing braces in the last commit.
3.: yes, it is intended for 32bit systems. I should probably add a note.
I think we should keep the code as simple as possible and ignore 64bit. What do you think?

from kprintf.

antoinealb avatar antoinealb commented on September 16, 2024

I think we should strive to keep the codebase warning-free. This should also include test builds in my opinion. Is it really more complicated to handle 64 bit pointers ?

from kprintf.

antoinealb avatar antoinealb commented on September 16, 2024

A very simple fix is simply this :

diff --git a/kprintf.c b/kprintf.c
index 09ec9ae..293bb6f 100644
--- a/kprintf.c
+++ b/kprintf.c
@@ -140,7 +140,7 @@ int vfkprintf(kprintf_write_fn_t writefn, const char *fmt, va_list arg)
                 void *p = va_arg(arg, void *);
                 str_buf[0] = '0';
                 str_buf[1] = 'x';
-                int slen = 2 + itoa_hex((uint32_t)p, str_buf + 2);
+                int slen = 2 + itoa_hex((size_t)p, str_buf + 2);
                 int len = writefn(str_buf, slen);
                 if (len != slen) {
                     return -1;

Of course it is no real 64 bit capability but we just want to be able to build our code without warnings.

from kprintf.

nuft avatar nuft commented on September 16, 2024

I think we should strive to keep the codebase warning-free

I agree.

to the fix: ok for me.

from kprintf.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.