Menu

#213 config/ag_macros.m4 has a couple of bugs

autogen
accepted
autoconf (1)
1
2022-12-11
2022-12-07
No

See attached patch for my proposed fixed.

First issue is a C99 compliance issue. No return type is specified for the function foo. Explicity return types are required by C99.

Second issue is a missing comma from the invocation of AC_RUN_IFELSE( missing a comma between it's first and second params. This result in a string being inserted into the C code which always causes the test to fail even when the strcspn function works fine.

1 Attachments

Discussion

  • Bruce Korb

    Bruce Korb - 2022-12-08
    • status: open --> accepted
    • assigned_to: Bruce Korb
     
  • Bruce Korb

    Bruce Korb - 2022-12-08

    Not defaulting to an "int" return type is a severe divergence from historical "C". Is that under the control of a cranked up warning level? That breaks the world. Anyway, I've applied your patch to my sources. If I can ever get "autoreconf" to work again, then I'll release it. :(

     
    • Florian Weimer

      Florian Weimer - 2022-12-11

      It's not that bad, implicit ints are somewhat rare and easy to fix. The implicit function declarations are more work in my experience, but they also provide greater benefit to programmers (although I've seen bugs due to implicit ints as well).

       
  • Bruce Korb

    Bruce Korb - 2022-12-11

    :) It's that bad for folks who like warnings as errors. A reasonable thing to do for project code. Probably, that shouldn't be done for configure probes. So, my project will be 4 bytes larger now. :-D

     

Log in to post a comment.

MongoDB Logo MongoDB