To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=89012
                 Issue #|89012
                 Summary|soltools/wntmsci10.pro/misc/hidc_yy.cxx error: 'isatty
                        |': identifier not found
               Component|tools
                 Version|BEA300m1
                Platform|All
                     URL|
              OS/Version|Windows, all
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|PATCH
                Priority|P3
            Subcomponent|code
             Assigned to|mh
             Reported by|tora





------- Additional comments from [EMAIL PROTECTED] Mon May  5 03:45:23 +0000 
2008 -------
### Problem ###
A compile error occurred.
../wntmsci10.pro\misc\hidc_yy.cxx(2483) : error C3861: 'isatty': identifier not
found, even with argument-dependent lookup
ERROR: Error 65280 occurred while making
/cygdrive/g/ooo/cws/fmepatches02/BEA300_m1/soltools/HIDCompiler


### Environment ###
OS: Windows 2000 Japanese SP4
Compiler: Microsoft Visual C++.net Standard Version 2003 (English)
Tools: 
  Cygwin
  flex 2.5.35
Source files:
  developer/BEA300_m1/OOo-Dev_BEA300_m1_src_binfilter.tar.bz2
  developer/BEA300_m1/OOo-Dev_BEA300_m1_src_core.tar.bz2
  developer/BEA300_m1/OOo-Dev_BEA300_m1_src_l10n.tar.bz2
  developer/BEA300_m1/OOo-Dev_BEA300_m1_src_sdk.tar.bz2
  developer/BEA300_m1/OOo-Dev_BEA300_m1_src_system.tar.bz2


### What I did ###
cd $SRC_ROOT/sw
(date ; time build.pl --all -- PRODUCT=full ; date ) 2>&1 | tee build.log


### Results ###
build.log
...(ommitted)...
=============
Building module soltools
=============
...(ommitted)...
c:/PROGRA~1/MICROS~1.NET/Vc7/bin/cl.exe -Zm500 -Zc:forScope -GR -c -nologo -Gs 
-Gy  -Gd  -I.  -I../wntmsci10.pro/misc -I../wntmsci10.pro/inc/hidc -I../inc
-I../inc/pch -I../inc -I../WIN/inc -I../wntmsci10.pro/inc -I.
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solver/300/wntmsci10.pro/inc/stl
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solver/300/wntmsci10.pro/inc/external
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solver/300/wntmsci10.pro/inc
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solenv/wntmsci10/inc
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solenv/inc
-Ig:/ooo/cws/fmepatches02/BEA300_m1/res
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solver/300/wntmsci10.pro/inc/stl
-Ic:/J2SDK1~1.2_0/include/win32 -Ic:/J2SDK1~1.2_0/include
-Ic:/PROGRA~1/MIFD68~1/include -Ic:/PROGRA~1/MICROS~1.NET/Vc7/include
-Ic:/PROGRA~1/MICROS~2.0SD/include
-Ic:/PROGRA~1/MICROS~1.NET/Vc7/PlatformSDK/include
-Ic:/PROGRA~1/MICROS~2.0SD/include    
-Ig:/ooo/cws/fmepatches02/BEA300_m1/solver/300/wntmsci10.pro/inc/offuh -I.
-I../res -I. -Wall -wd4061 -wd4063 -wd4127 -wd4191 -wd4217 -wd4250 -wd4251    
-wd4275 -wd4290 -wd4292 -wd4294 -wd4344 -wd4347 -wd4355 -wd4503 -wd4511    
-wd4512 -wd4514 -wd4611 -wd4619 -wd4625 -wd4626 -wd4640 -wd4675 -wd4686    
-wd4710 -wd4711 -wd4786 -wd4800 -wd4820   -DWNT -DWNT -DNT351 -DMSC -DM1310
-DINTEL -D_X86_=1 -DFULL_DESK -DSTLPORT_VERSION=400 -DWINVER=0x400
-D_WIN32_IE=0x400 -D_MT -DCPPU_ENV=msci -DSUPD=300 -DPRODUCT -DNDEBUG
-DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA -DBEA300=BEA300
  -DYY_NEVER_INTERACTIVE=1  -DWIN32 -D_MT -D_DLL -DWIN32 -D_MT -D_DLL 
-DEXCEPTIONS_OFF  -Fo../wntmsci10.pro/obj/wrap_hidclex.obj
g:/ooo/cws/fmepatches02/BEA300_m1/soltools/HIDCompiler/wrap_hidclex.cxx
wrap_hidclex.cxx
../wntmsci10.pro\misc\hidc_yy.cxx(2483) : error C3861: 'isatty': identifier not
found, even with argument-dependent lookup
dmake:  Error code 2, while making '../wntmsci10.pro/obj/wrap_hidclex.obj'

ERROR: Error 65280 occurred while making
/cygdrive/g/ooo/cws/fmepatches02/BEA300_m1/soltools/HIDCompiler

### Quick Investigation ###
../wntmsci10.pro/misc/hidc_yy.cxx
  2456  #ifndef __cplusplus
  2457  extern int isatty (int );
  2458  #endif /* __cplusplus */
  2459      
  2460  /* Initializes or reinitializes a buffer.
  2461   * This function is sometimes called more than once on the same buffer,
  2462   * such as during a yyrestart() or at EOF.
  2463   */
  2464      static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
  2465  
  2466  {
  2467          int oerrno = errno;
  2468      
  2469          yy_flush_buffer(b );
  2470  
  2471          b->yy_input_file = file;
  2472          b->yy_fill_buffer = 1;
  2473  
  2474      /* If b is the current buffer, then yy_init_buffer was _probably_
  2475       * called from yyrestart() or through yy_get_next_buffer.
  2476       * In that case, we don't want to reset the lineno or column.
  2477       */
  2478      if (b != YY_CURRENT_BUFFER){
  2479          b->yy_bs_lineno = 1;
  2480          b->yy_bs_column = 0;
  2481      }
  2482  
  2483          b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  2484      
  2485          errno = oerrno;
  2486  }

isatty() can be found in the line 2483.

### Reference 1 ###
/usr/share/info/flex.info-1
says

Why do flex scanners call fileno if it is not ANSI compatible?
==============================================================

Flex scanners call `fileno()' in order to get the file descriptor
corresponding to `yyin'. The file descriptor may be passed to
`isatty()' or `read()', depending upon which `%options' you specified.
If your system does not have `fileno()' support, to get rid of the
`read()' call, do not specify `%option read'. To get rid of the
`isatty()' call, you must specify one of `%option always-interactive' or
`%option never-interactive'.


### Reference 2 ###
http://msdn.microsoft.com/en-us/library/ms235388.aspx
says

This POSIX function is deprecated beginning in Visual C++ 2005. 
Use the ISO C++ conformant _isatty instead.


### Thoughts ###
HID Compiler, hidc, is normally used in the non-interactive mode.
Visual C++ 2005 suggests not to use a function isatty().
According to the info of flex, inclusion of the function isatty() 
seems to be suppressed by adding a directive '%option never-interactive' 
in a source file to flex.


### Experiment ###
An attempt of removing isatty() from an output of flex by inserting 
a directive '%option never-interactive' to soltools/HIDCompiler/hidclex.l: 

Index: hidclex.l
===================================================================
RCS file: /cvs/tools/soltools/HIDCompiler/hidclex.l,v
retrieving revision 1.7
diff -U 5 -r1.7 hidclex.l
--- hidclex.l   10 Apr 2008 17:56:30 -0000      1.7
+++ hidclex.l   5 May 2008 03:12:21 -0000
@@ -469,10 +469,11 @@
 
 //string               (\"[^"]*\") alter einfacher string ohne "
 
 %}
 
+%option never-interactive
 simple         ([^\n\"]*)
 %p 7000
 string         \"{simple}((((\\\\)*(\\\"))?){simple})*\"
 
 %x MACRO_STATE


### Results of the Attempt ###

That is successful as below:

../wntmsci10.pro/misc/hidc_yy.cxx
  2460      static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
  2461  
  2462  {
  2463          int oerrno = errno;
  2464      
  2465          yy_flush_buffer(b );
  2466  
  2467          b->yy_input_file = file;
  2468          b->yy_fill_buffer = 1;
  2469  
  2470      /* If b is the current buffer, then yy_init_buffer was _probably_
  2471       * called from yyrestart() or through yy_get_next_buffer.
  2472       * In that case, we don't want to reset the lineno or column.
  2473       */
  2474      if (b != YY_CURRENT_BUFFER){
  2475          b->yy_bs_lineno = 1;
  2476          b->yy_bs_column = 0;
  2477      }
  2478  
  2479          b->yy_is_interactive = 0;
  2480      
  2481          errno = oerrno;
  2482  }

isatty() disappears.


### Retrying the dmake ###
cd $SRC_ROOT/soltools/HIDCompiler
dmake PRODUCT=full 

That now produces no error.


### Conclusion ###
To avoid a potential compile error, which could happen under certain 
environments, inserting '%option never-interactive' in 
soltools/HIDCompiler/hidclex.l is recommended.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to