Skip to content
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

gpre C++ compiler warnings with GCC 4.4.1 [CORE3022] #3403

Closed
firebird-issue-importer opened this issue May 28, 2010 · 10 comments
Closed

gpre C++ compiler warnings with GCC 4.4.1 [CORE3022] #3403

firebird-issue-importer opened this issue May 28, 2010 · 10 comments

Comments

@firebird-issue-importer

Submitted by: @AlexPeshkoff

Attachments:
AmbigiousElseWarning.patch

Issue was reported and patch provided by Daniel Dodson <mailto:zabbit@yahoo.com>

When compiling generated C++ from gpre I was receiving a warning "ambiguous else statement". From the following kind of statement...

EXEC SQL
    SELECT COUNT\(\*\)
    INTO :count
    FROM RDB$RELATIONS
    WHERE RDB$RELATION\_NAME=:a\_tablename;

it was outputting, in part, the following code

   if \(\!SQLCODE\)
      if \(isc\_4\.isc\_6\)
         \{
         count = isc\_4\.isc\_5;
         \}
      else
         SQLCODE = 100;

Legally I don't think this is a problem because the else statement applies to the nearest 'if' statement (so the second one in this case). However I didn't want to add a rule to ignore this warning because that would be bad practise in hand crafted C++ and I would want it highlighted. So rather than add a rule for different flags I decided to modify gpre so that the following is produced...

   if \(\!SQLCODE\)
      \{

      if \(isc\_4\.isc\_6\)

         \{

         count = isc\_4\.isc\_5;

         \}

      else
         \{

         SQLCODE = 100;
         \}
      \}

Commits: f126fd5 800d801 e562c8f a233141

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2010

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2010

Modified by: @AlexPeshkoff

Attachment: AmbigiousElseWarning.patch [ 11631 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2010

Modified by: @AlexPeshkoff

Fix Version: 2.1.4 [ 10361 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2010

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Open [ 1 ]

Target: 3.0 Alpha 1, 2.0.7, 2.5.1 [ 10331, 10390, 10333 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 10, 2010

Modified by: @AlexPeshkoff

Target: 3.0 Alpha 1, 2.0.7, 2.5.1 [ 10331, 10390, 10333 ] => 2.5.1 [ 10333 ]

status: Open [ 1 ] => Open [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.0.7 [ 10390 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 14, 2010

Commented by: @AlexPeshkoff

Applied suggested patch

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 14, 2010

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 4, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 24, 2016

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment