Sponsored Content
Full Discussion: is this a bug of g++?
Top Forums Programming is this a bug of g++? Post 302503614 by homeboy on Friday 11th of March 2011 05:34:46 AM
Old 03-11-2011
Quote:
Originally Posted by jlliagre
It isn't the same, at least with my tests here. cin.sync() doesn't flush the buffer so I experience the same issue with it. Reading cin in a string breaks the endless loop.
yeah,sometimes it won't work by adding sync(),such as with my platform and my compiler version,as i said above,mingw works fine.Your solution is a good way to handle this problem.But i'm wondering is there a portable way to eliminate such a problem.Because we may do something like:
cin>>a_int>>a_string>>a_double;
what if the error occurs when we get the first value(enter a string when needs a integer)?we have to use getline() to flush the invalid data.
 

8 More Discussions You Might Find Interesting

1. Programming

Bug has developed

Guys there is another bug that has developed.........now messaged above 6 bytes are trimmed and echoed back to client.After the first message the echo is not regular.I have put a loop in both client and server to check for closing.Moreover for connection close i also need to put another clause that... (3 Replies)
Discussion started by: arjunjag
3 Replies

2. Post Here to Contact Site Administrators and Moderators

Have I found a bug?

When searching for new posts, I see that my voting in one of the polls counts as a 'new post'. However, while the '<blah> minutes ago' entry updates correctly, the 'by <username>' is the last user to actually post a comment in the poll instead. Result: Poll: vB Guest Book 39... (4 Replies)
Discussion started by: Smiling Dragon
4 Replies

3. UNIX for Advanced & Expert Users

logrotate bug?

I have been mailing myself logs for a while, but just ran into a problem because of a process that cannot HUP its log. (I realize thats why they implemented the "copytruncate" option in the first place) When I use logrotate with "copytruncate" and "compress" there is a problem. The "myScript"... (0 Replies)
Discussion started by: jjinno
0 Replies

4. Shell Programming and Scripting

Is it a bug ..?

Hi All, I am using Red Hat Linux on my servers. The problem that I am facing is, sometimes the /opt usage on the server shows used percentage as 100% , when actually it is simply 20%. When I reboot the system, it comes back to 20%.Is this a bug in the system or my settings have gone wrong... (1 Reply)
Discussion started by: nua7
1 Replies

5. AIX

bug in 43 ???

xxxxserver# lsattr -El inet0 | grep 255.240.0.0,32.224.0.0,32.78.120.254 | grep '.40' route net,-hopcount,1,-netmask,255.240.0.0,32.224.0.0,32.78.120.254 How this is possible? (1 Reply)
Discussion started by: itik
1 Replies

6. UNIX for Dummies Questions & Answers

where's the bug?

#!/bin/bash if then #echo "infinite loop" exit 0 fi when I run this file I get the following error: ./test_infinite_loop: line 5: syntax error near unexpected token `fi' ./test_infinite_loop: line 5: `fi' :confused: (4 Replies)
Discussion started by: jon80
4 Replies

7. Shell Programming and Scripting

How to fix this bug?

Hi gurus, I have script as below: #!/bin/ksh while : do cat /dev/null > srcfile exit_time=`TZ=GMT-20 date +%Y%m%d1950` cur_time=`date +%Y%m%d%H%M` flag=1 if ; then ... (7 Replies)
Discussion started by: ken6503
7 Replies

8. UNIX for Advanced & Expert Users

A $(( expression )) bug?

This is for the big guns... I have been modifying AudioScope.sh to bring it inline with more current practices. I hit a bug which IS not present in the original code but was after modification. Shell check first:- #!/bin/sh txt="1234567890" echo "$(( $txt ))" echo "$(( ${#txt} - 1 ))" echo... (17 Replies)
Discussion started by: wisecracker
17 Replies
GLDELETESYNC(3G)						    OpenGL 3.3							  GLDELETESYNC(3G)

NAME
glDeleteSync - delete a sync object C SPECIFICATION
void glDeleteSync(GLsync sync); PARAMETERS
sync The sync object to be deleted. DESCRIPTION
glDeleteSync deletes the sync object specified by sync. If the fence command corresponding to the specified sync object has completed, or if no glWaitSync() or glClientWaitSync() commands are blocking on sync, the object is deleted immediately. Otherwise, sync is flagged for deletion and will be deleted when it is no longer associated with any fence command and is no longer blocking any glWaitSync() or glClientWaitSync() command. In either case, after glDeleteSync returns, the name sync is invalid and can no longer be used to refer to the sync object. glDeleteSync will silently ignore a sync value of zero. NOTES
glSync is only supported if the GL version is 3.2 or greater, or if the ARB_sync extension is supported. ERRORS
GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object. SEE ALSO
glFenceSync(), glWaitSync(), glClientWaitSync() COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. OpenGL 3.3 03/08/2011 GLDELETESYNC(3G)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy