Giter Club home page Giter Club logo

Comments (6)

vozlt avatar vozlt commented on June 12, 2024

Thanks for suggesting it.
I fixed it.
Please test if the C1091 occur when compiling in the latest commit.

Latest commit: 9d5c74e

from nginx-module-sts.

dafanasiev avatar dafanasiev commented on June 12, 2024

Some issues:

  • sizeof("123") != sizeof( char[] {'1','2','3'} ) - did you forget about NULL term in char string?
    (as I see you calc size of array in ngx_http_stream_server_traffic_status_display.c:360)
  • VS use precompiled headers, so every .c file must contains #include <ngx_config.h> at the top
  • also uninitialized key.data, so add key.data = NULL; after ngx_http_stream_server_traffic_status_display.c:646

and after that it look like ok.

from nginx-module-sts.

vozlt avatar vozlt commented on June 12, 2024

OK, you are right. 😆
I fixed it.

  1. added NULL into char array.
  2. included ngx_config.h into ngx_http_stream_server_traffic_status_module.h and ngx_http_stream_server_traffic_status_string.c files. (Please check if an compile error occurs.)
  3. initialized key variable by ngx_memzero().

Please test.
Latest commit: 391a4de

from nginx-module-sts.

dafanasiev avatar dafanasiev commented on June 12, 2024
  1. PCH feature only work when include added to every .c file (not .h), so now i cant build without modifications..

from nginx-module-sts.

vozlt avatar vozlt commented on June 12, 2024

OK, I added it.
Please check it.
FYI. I'm just curious. Is it possible to disable pre-compiled headers feature when compiling?

Latest commit: a5d65d0

from nginx-module-sts.

dafanasiev avatar dafanasiev commented on June 12, 2024

Yeah, now all ok.

Yes, you can disable using PCH using -Y* options (see here), but by default nginx configure script generate makefile with -Yu:

....
objs/ngx_modules.obj:	$(CORE_DEPS) \
	objs/ngx_modules.c
	$(CC) -c $(CFLAGS) -Yungx_config.h -Fpobjs/ngx_config.pch $(ALL_INCS) \
		-Foobjs/ngx_modules.obj \
		objs/ngx_modules.c
....

File ngx_modules.c contains references to all modules: kernel and that was added with --add-module args (when you call configure.sh).
So, by default nginx build use precompiled headers when compile via MSVC.

from nginx-module-sts.

Related Issues (13)

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.