-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flex.skl calls fileno(), which is not ISO C99 function #263
Comments
What about rewriting to not use fileno() and being C99 compliant that way? |
I checked against my copy of the glibc reference manual and it doesn't note anything special about fileno() as well. Which is unfortunate given what you describe. |
@westes
|
On Monday, 4 September 2017, 8:44 am -0700, "Kang-Che Sung (宋岡哲)" ***@***.***> wrote:
@westes
For your first question, it won't help much if we replace fileno() with something else since the routine already depends on isatty(), and so I'm pursuing only to have the feature macro defined.
Fair enough. At some level, however, It seems reasonable to assume a few things -- C99 and POSIX are both hardly new, for instance. If it's just a matter of ensuring that feature macros get defined in ways people expect, that is reasonable. But isatty() has been around since SVR4 and 4.3BSD according to the man page, so I'm not worried about systems that "forget" to declare it.
For your second question, glibc manual doesn't explicitly mention about feature macro requirements, but Linux man pages does, as well as the code of "/usr/include/stdio.h" and "features.h":
I was not doubting your description. It's just unfortunate that the glibc reference manual I have on my system doesn't make any note of the feature macros needed to provide the function.
…--
Will Estes
Flex Project Maintainer
westes575@gmail.com
https://github.com/westes/flex
|
This fixes westes#263 where we lack feature macro to expose the API of fileno().
This fixes westes#263 where we lack feature macro to expose the API of fileno().
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
Flex prior to 2.6.6 uses fileno() but does not define the needed feature test macros. See westes/flex#263 for details. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
I caught this warning when building flex in
-std=c99
mode:In glibc, fileno() prototype is exposed only if
_POSIX_C_SOURCE
is defined to>= 1
. Although flex will build with_GNU_SOURCE
defined (AC_USE_SYSTEM_EXTENSIONS in configure script), the problem is that generated scanners may not build if the user's environment requires strict ISO C99, and I consider this a bug.So this issue report is about two things:
#define _POSIX_C_SOURCE 1
is missing in flex.skl when the scanner is specified neitheralways-interactive
ornever-interactive
option.The text was updated successfully, but these errors were encountered: