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-automations opened this issue May 28, 2010 · 10 comments
Closed

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

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

Comments

@firebird-automations
Copy link
Collaborator

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-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Attachment: AmbigiousElseWarning.patch [ 11631 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 2.1.4 [ 10361 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

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

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Applied suggested patch

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

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