Coder Social home page Coder Social logo

Comments (5)

eyalroz avatar eyalroz commented on July 20, 2024

I did mess that up. Working on it.

from printf.

eyalroz avatar eyalroz commented on July 20, 2024

@thestumbler : Can you please try it again now?

from printf.

thestumbler avatar thestumbler commented on July 20, 2024

I just tested it, the latest commit on the develop branch. No joy.
First of all , my compiler (gnu arm-none-eabi-g++ v 6.3.1 Atmel build for Atmel/Microchip SAM-E5x chip) doesn't like the preprocessor #if statement without a conditional (the second line from the snippet below)

#ifdef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
# define printf_    printf
# define sprintf_   sprintf
# define vsprintf_  vsprintf
# define snprintf_  snprintf
# define vsnprintf_ vsnprintf
# define vprintf_   vprintf
#endif
#endif

Even when commenting this out in all three places (twice in the h file and once in the c file), it doesn't actually work.
I got it to work by basically putting it back like before:

(1) swapped all of the definitions around at the top of the header file, e.g...

WAS: # define printf_    printf
 IS: # define printf    printf_

(2) removed the #undef block at the end of the header file, and removed the duplicate? block at the top of the c file.

from printf.

thestumbler avatar thestumbler commented on July 20, 2024

"commenting this out in all three places..." I mean like this:

#ifdef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
//#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
# define printf_    printf
# define sprintf_   sprintf
# define vsprintf_  vsprintf
# define snprintf_  snprintf
# define vsnprintf_ vsnprintf
# define vprintf_   vprintf//
//#endif
#endif

from printf.

eyalroz avatar eyalroz commented on July 20, 2024

First of all , my compiler (gnu arm-none-eabi-g++ v 6.3.1 Atmel build for Atmel/Microchip SAM-E5x chip) doesn't like the preprocessor #if statement without a conditional (the second line from the snippet below)

Ok, I'll change it to

#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES 0
#endif

Even when commenting this out in all three places (twice in the h file and once in the c file), it doesn't actually work. I got it to work by basically putting it back like before:

The thing is, I can't do that. We can't go around replacing print's in people's source code, outside the library, with printf_. Those replacements will happen in comments, in C++ namespaces... can't have that. The macros must be undefined at the end of the header.

from printf.

Related Issues (20)

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.