Giter Site home page Giter Site logo

Comments (5)

rmustacc avatar rmustacc commented on August 9, 2024

That's correct, the places where we have the new path the arguments are in the wrong order here. Thanks.

from illumos-extra.

rmustacc avatar rmustacc commented on August 9, 2024

Thanks for reporting this again. It should be fixed in 22516fa.

from illumos-extra.

 avatar commented on August 9, 2024

Hmm, just making sure, but it seems that the sprintf statement expects 5 arguments ("%s%s%s/%s:%s") but now there are only four.
Shouldn't an %s be suppressed for the case oldpathX==null ?

  if (oldpath == NULL) {
- sprintf(newpath, "%s%s", newpath, LD_SUPPORT_MAKE_LIB);
+ sprintf(newpath, "%s%s%s/%s:%s",
+ MAKE_PREFIX, LD_SUPPORT_MAKE_LIB_DIR,
+ LD_SUPPORT_MAKE_LIB, LD_SUPPORT_MAKE_LIB) + 1;
  } else {
- sprintf(newpath, "%s:%s", newpath, LD_SUPPORT_MAKE_LIB);
+ sprintf(newpath, "%s:%s%s/%s:%s",
+ newpath, MAKE_PREFIX,
+ LD_SUPPORT_MAKE_LIB_DIR, LD_SUPPORT_MAKE_LIB,
+ LD_SUPPORT_MAKE_LIB) + 1;
+
+ }

(also, I believe the +1 is a copy/paste from earlier len=snprintf statements)

from illumos-extra.

 avatar commented on August 9, 2024

Perhaps this should be reopened for the moment...
Thought I'd try cppcheck:

richard@devzoneX:~/src/dmake/usr/src/make_src/Make/bin/make/common$ cppcheck main.cc
Checking main.cc...
Checking main.cc: ADDFIX5060758...
Checking main.cc: DISTRIBUTED...
Checking main.cc: DISTRIBUTED;TEAMWARE_MAKE_CMN...
Checking main.cc: DMAKE_STATISTICS...
Checking main.cc: MAXJOBS_ADJUST_RFE4694000;TEAMWARE_MAKE_CMN...
Checking main.cc: NSE...
Checking main.cc: PARALLEL...
Checking main.cc: PREFIX...
[main.cc:2142]: (error) sprintf format string has 5 parameters but only 4 are given.
[main.cc:2154]: (error) sprintf format string has 5 parameters but only 4 are given.
[main.cc:2147]: (error) Undefined behavior: Variable 'newpath' is used as parameter and destination in s[n]printf().
[main.cc:2160]: (error) Undefined behavior: Variable 'newpath64' is used as parameter and destination in s[n]printf().
Checking main.cc: REDIRECT_ERR;TEAMWARE_MAKE_CMN...
Checking main.cc: SGE_SUPPORT...
Checking main.cc: SGE_SUPPORT;TEAMWARE_MAKE_CMN...
(information) Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.

may turn out to be a useful tool in your solaris make update.

from illumos-extra.

rmustacc avatar rmustacc commented on August 9, 2024

It's unfortunate that Sun Studio doesn't / what make historically did doesn't actually check these kinds of things. Feel free to open another issue on this specific thing and if you have the cycles provide an updated patch.

from illumos-extra.

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.