Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!not-for-mail From: jt@toerring.de (Jens Thoms Toerring) Newsgroups: comp.os.linux.development.apps,comp.lang.c,comp.lang.c++ Subject: Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Date: 8 Jan 2012 16:35:25 GMT Organization: Freie Universitaet Berlin Lines: 46 Message-ID: <9mtuudF8esU1@mid.uni-berlin.de> References: <3f058b58-9035-4981-b5cb-97ca01476423@w4g2000vbc.googlegroups.com> X-Trace: news.uni-berlin.de /9tX00BXeSVoQ8Tme1KE5QvgtUz+6+Q8PpNbSMeQwDd/Yl X-Orig-Path: not-for-mail User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.30-1-amd64 (x86_64)) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:368 comp.lang.c:15587 comp.lang.c++:13174 In comp.lang.c OtagoHarbour wrote: > I am using NetBeans IDE 7.0.1 to build a C++ application on Ubuntu > 11.08. I would guess that it's either Ubuntu 11.04 or 11.10, there is no 11.08 vaersion. And if you write on C++ it would also seem to be preferable to ask in the C++ nwesgroup, comp.lang.c++. > I have code written in C++ and it builds fine in Debug mode. However, > when I try to build it in Release mode I get the following errors. > /usr/include/i386-linux-gnu/bits/fcntl2.h:51:26 error: call to ' open > missing mode' declared with attribute error: open with O_CREAT in > second argument needs 3 arguments. > I have the following definition files included. > #include > #include > #include Obviously this is a Unix related problem, since there is no open() function in either stamdard C or C++, thus a better place to ask would be e.g. comp.unix.programmer. But what you have to do seems rather clear: for some reasons the the compiler gets passed some flags in "release" mode that aren't set in "debug" mode and which result in some extra checks being done (I would suspect that in "debug" mode the -O0 flag is passed to the compiler to disable optimizatation, but that also makes the detection of certain potential pro- blems impossible). And with those extra flags it detects that in some place in your code open() is called with 'O_CREAT' being set in the second argument and there's no third argu- ment, which in this case is required. The only reasonable fix for that is to go to the places in your code where open() is used and misses the required third argument (the exact plave is rather likely shown in the error message from the compiler just before the line you cited) and fix that. It's rather likely that your program will exhibit rather strange behaviour if you don't do so (at least the permission flags for the file might be set randomly, which isn't a good thing at all). Regards, Jens -- \ Jens Thoms Toerring ___ jt@toerring.de \__________________________ http://toerring.de