Menu

#8 implicit declaration of function ‘putenv’; did you mean ‘getenv’?

v1.0 (example)
open
nobody
None
5
2022-02-19
2020-08-21
No

Hello!
It seems tat putenv is used to just check for an env variable. But putenv actually changes the environment...

bwb_fnc.c:966:13: warning: implicit declaration of functionputenv; did you mean ‘getenv’? [-Wimplicit-function-declaration]
  966 |         if (putenv (A) == -1)
      |             ^~~~~~
      |             getenv

I'n not sure if that should have been getenv instead -- but either way, that file should include stdlib.h.

Discussion

  • Daniel D. Rodrigues

    I got the same error.

     
  • AF5NE

    AF5NE - 2022-02-19

    My apologies for the late response -- I am not often online.
    If you would be so kind, please try this:

    gcc -D_SVID_SOURCE -o bwbasic -lm bw*.c

     

Log in to post a comment.