Coder Social home page Coder Social logo

zma / zlog Goto Github PK

View Code? Open in Web Editor NEW
58.0 6.0 18.0 72 KB

A low-latency in-memory C logging library

Home Page: https://www.ericzma.com/projects/zlog/

License: The Unlicense

C 78.90% Makefile 2.12% Meson 18.98%
c in-memory logger logging logging-library

zlog's Issues

Compiler warnings: format-truncation

Hi,

I hit this issue when compiling with GCC 8 with -Wall:

zlog/zlog.c: In function ‘zlogf_time’:
zlog/zlog.c:172:51: error: ‘.’ directive output may be truncated writing 1 byte into a region of size between 0 and 127 [-Werror=format-truncation=]
     snprintf(buffer, ZLOG_BUFFER_STR_MAX_LEN, "[%s.%06lds] ", timebuf, tv.tv_usec);
                                                   ^
zlog/zlog.c:172:5: note: ‘snprintf’ output between 12 and 153 bytes into a destination of size 128
     snprintf(buffer, ZLOG_BUFFER_STR_MAX_LEN, "[%s.%06lds] ", timebuf, tv.tv_usec);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zlog/zlog.c: In function ‘zlog_time’:
zlog/zlog.c:203:51: error: ‘.’ directive output may be truncated writing 1 byte into a region of size between 0 and 127 [-Werror=format-truncation=]
     snprintf(buffer, ZLOG_BUFFER_STR_MAX_LEN, "[%s.%06lds] [@%s:%d]", timebuf, tv.tv_usec, filename, line);
                                                   ^
zlog/zlog.c:203:5: note: ‘snprintf’ output 17 or more bytes (assuming 144) into a destination of size 128
     snprintf(buffer, ZLOG_BUFFER_STR_MAX_LEN, "[%s.%06lds] [@%s:%d]", timebuf, tv.tv_usec, filename, line);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Thanks for zlog! :)

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.