Git Product home page Git Product logo

qrintf's Introduction

H2O - an optimized HTTP server with support for HTTP/1.x, HTTP/2 and HTTP/3 (experimental)

CI Coverity Scan Build Status Fuzzing Status

Copyright (c) 2014-2019 DeNA Co., Ltd., Kazuho Oku, Tatsuhiko Kubo, Domingo Alvarez Duarte, Nick Desaulniers, Marc Hörsken, Masahiro Nagano, Jeff Marrison, Daisuke Maki, Laurentiu Nicola, Justin Zhu, Tatsuhiro Tsujikawa, Ryosuke Matsumoto, Masaki TAGAWA, Masayoshi Takahashi, Chul-Woong Yang, Shota Fukumori, Satoh Hiroh, Fastly, Inc., David Carlier, Frederik Deweerdt, Jonathan Foote, Yannick Koechlin, Harrison Bowden, Kazantsev Mikhail

H2O is a new generation HTTP server. Not only is it very fast, it also provides much quicker response to end-users when compared to older generations of HTTP servers.

Written in C and licensed under the MIT License, it can also be used as a library.

For more information, please refer to the documentation at h2o.examp1e.net.

Reporting Security Issues

Please report vulnerabilities to [email protected]. See SECURITY.md for more information.

qrintf's People

Contributors

dhobsd avatar drew-richardson avatar gfx avatar imasahiro avatar kazuho avatar matsumotory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qrintf's Issues

'%%' conversion is wrong

input

% cat test.c
sprintf(buf, "%d%%", 10);

output

% ./qrintf-pp  < test.c
Use of uninitialized value in concatenation (.) or string at ./qrintf-pp line 83, <STDIN> line 1.
_qrintf_finalize(_qrintf_%(_qrintf_d(_qrintf_init(buf) , 10)));

improve support for clang

As of now, we have a code that emulates the behavior of gcc -wrapper in case clang (or other compiler) is being used.

However the argument parsing logic of the emulation is horrible; it just strips -o target and assumes that the last argument is the name of the source file. It is evident that such approach will fail in certain cases, e.g. when -Wl, is used after specifying the source file, or, when more than one source files are used.

We need to implement a better option parser like the one found in ccache or dist-cc.

possible error

Was just glancing through the code and noticed this in qrintf.h, is it a mistake?
if (sizeof(unsigned long long) == sizeof(unsigned long long))

undefining sprintf/snprintf

Hi,

This is issue is not an issue, but a question.

What is the reason of redefining sprintf/snprintf to _qp_sprintf/_qp_snprintf which are not defined?
Is it a bug or is it supposed to be so?

I bumped to this matter because I want to use qrintf for hotspots and keep using sprintf for "regular" cases where simplicity and clearness matters more then speed.

With this block in qrintf.h I'm getting "undefined symbol: _qp_snprintf" error in runtime.

#undef sprintf
#define sprintf(...) _qp_sprintf(__VA_ARGS__)
#undef snprintf
#define snprintf(...) _qp_snprintf(__VA_ARGS__)

cmake: Detecting C compile features - failed

Hi,

When I try to use qrintf with cmake, I got following errors:

➜  cmake-build-debug git:(master) CC="/usr/local/bin/qrintf cc" cmake ..
-- The C compiler identification is GNU 8.1.0
-- Check for working C compiler: /usr/local/bin/qrintf
-- Check for working C compiler: /usr/local/bin/qrintf -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - failed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done

As you can see, the cmake try to test the C compile features, but it failed.

How we integrate qrintf with cmake?

qrintf issues with autotools

I'm not a fan of autotools, but can't work around using it in this case. I encountered several issues when integrating qrintf into our Varnish build:

Because qrintf.h is included very early in the compile process, a number of header files are pulled in before any chance of including config.h is allowed. This breaks packages that self-define C environment options like _GNU_SOURCE or _XOPEN_SOURCE or the like.

In my specific case, this was solved by hacking qrintf.h to include:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

fixes the issue. I would submit a PR, but I'm sure that someone has an autotools build where the relevant guard is _HAVE_CONFIG_H and the file is also named differently.

I ran into a couple of other problems related to autohell:

  1. When qrintf-gcc is specified as the CC to use for configure, a number of header feature tests break. (A ffsl(3) test failed in jemalloc, for a specific case.) I worked around this by specifying CC as an argument to make.
  2. CFLAGS are not passed to qrintf-gcc. This requires one to set relevant build options a la CC="qrintf-gcc -std=gnu99 -Werror -Wall" make.

All of these things would be more easily resolved if it was easier / safer to include qrintf in projects built using these "tools". (In the meantime, I've worked around these issues, so this is not a high priority issue or anything. I'd be happy to submit patches if you have better ideas than the hacky ones I made.)

Support for Clang

qrintf-gcc uses -no-integrated-cpp and -wrapper, options specific to GCC.

clarify license

Would be nice to see explicitly with which open source licenses this code is compatible.

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.