Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #13172 > unrolled thread

fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08

Started byOtagoHarbour <peterdlauren@gmail.com>
First post2012-01-08 06:47 -0800
Last post2012-01-08 20:13 +0000
Articles 6 — 5 participants

Back to article view | Back to comp.lang.c++


Contents

  fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 OtagoHarbour <peterdlauren@gmail.com> - 2012-01-08 06:47 -0800
    Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-08 15:53 +0000
      Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Kaz Kylheku <kaz@kylheku.com> - 2012-01-08 18:39 +0000
        Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-08 18:45 +0000
    Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 jt@toerring.de (Jens Thoms Toerring) - 2012-01-08 16:35 +0000
      Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-08 20:13 +0000

#13172 — fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08

FromOtagoHarbour <peterdlauren@gmail.com>
Date2012-01-08 06:47 -0800
Subjectfcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08
Message-ID<3f058b58-9035-4981-b5cb-97ca01476423@w4g2000vbc.googlegroups.com>
I am using NetBeans IDE 7.0.1 to build a C++ application on Ubuntu
11.08.

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 <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

I duplicated the properties for the Debug build and renamed the
duplicate Release so it built perfectly just like the Debug version.
Then I went to the C++ compiler and changed
Basic Options: Development Mode from Debug to Release. That was what
caused the problem with fcntl.h

Any assistance with fixing this problem would be greatly appreciated.

Thanks.
Peter

[toc] | [next] | [standalone]


#13173

FromRichard Kettlewell <rjk@greenend.org.uk>
Date2012-01-08 15:53 +0000
Message-ID<87pqeup4w0.fsf@araminta.anjou.terraraq.org.uk>
In reply to#13172
OtagoHarbour <peterdlauren@gmail.com> writes:

> I am using NetBeans IDE 7.0.1 to build a C++ application on Ubuntu
> 11.08.
>
> 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 <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
>
> I duplicated the properties for the Debug build and renamed the
> duplicate Release so it built perfectly just like the Debug version.
> Then I went to the C++ compiler and changed
> Basic Options: Development Mode from Debug to Release. That was what
> caused the problem with fcntl.h
>
> Any assistance with fixing this problem would be greatly appreciated.

The message looks fairly straightforward; check that your call(s) to
open() are correct.  The checking version is only defined conditionally
which presumably explains why you only see the error in certain
configurations.

-- 
http://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


#13175

FromKaz Kylheku <kaz@kylheku.com>
Date2012-01-08 18:39 +0000
Message-ID<20120108103348.176@kylheku.com>
In reply to#13173
On 2012-01-08, Richard Kettlewell <rjk@greenend.org.uk> wrote:
> OtagoHarbour <peterdlauren@gmail.com> writes:
>
> The message looks fairly straightforward; check that your call(s) to
> open() are correct.  The checking version is only defined conditionally
> which presumably explains why you only see the error in certain
> configurations.

These checks are done in the body of an inline version of open which calls an
appropriate variant based on what arguments are present. I'm guessing that
these checks get hoisted into compile time under optimization.

[toc] | [prev] | [next] | [standalone]


#13176

FromRichard Kettlewell <rjk@greenend.org.uk>
Date2012-01-08 18:45 +0000
Message-ID<87boqeowy0.fsf@araminta.anjou.terraraq.org.uk>
In reply to#13175
Kaz Kylheku <kaz@kylheku.com> writes:
> Richard Kettlewell <rjk@greenend.org.uk> wrote:

>> OtagoHarbour <peterdlauren@gmail.com> writes:
>>
>> The message looks fairly straightforward; check that your call(s) to
>> open() are correct.  The checking version is only defined conditionally
>> which presumably explains why you only see the error in certain
>> configurations.
>
> These checks are done in the body of an inline version of open which calls an
> appropriate variant based on what arguments are present. I'm guessing that
> these checks get hoisted into compile time under optimization.

Oh, yes, that makes more sense.

-- 
http://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


#13174

Fromjt@toerring.de (Jens Thoms Toerring)
Date2012-01-08 16:35 +0000
Message-ID<9mtuudF8esU1@mid.uni-berlin.de>
In reply to#13172
In comp.lang.c OtagoHarbour <peterdlauren@gmail.com> 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 <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>

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

[toc] | [prev] | [next] | [standalone]


#13179

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2012-01-08 20:13 +0000
Message-ID<slrnjgju79.1ls.grahn+nntp@frailea.sa.invalid>
In reply to#13174
["Followup-To:" header set.]

On Sun, 2012-01-08, Jens Thoms Toerring wrote:
> In comp.lang.c OtagoHarbour <peterdlauren@gmail.com> 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 <sys/types.h>
>> #include <sys/stat.h>
>> #include <fcntl.h>
>
> 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.

He's already crossposting to comp.os.linux.development.apps which is
probably a better place since the problem is with gcc and/or glibc.
Followup-to set.

It's probably also a good idea for the OP to explain what "Debug" and
"Release" means precisely, in terms of compiler options. Most Linux
people don't use that IDE (or a Visual Studio-style Debug/Release
dichotomy, for that matter).

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web