Bug #2908 C++ style comment in C source file
Submitted: 20 Feb 2004 12:06 Modified: 21 Feb 2004 5:22
Reporter: Jeremy Baumgartner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.18 OS:Solaris (Solaris 8)
Assigned to: Sergei Golubchik CPU Architecture:Any

[20 Feb 2004 12:06] Jeremy Baumgartner
Description:
When compiling mysql 4.0.18 on Solaris 8 with the Sun Forte Compiler, compilation stopped at libmysql/net.c, line 768 with a parse error.

It appears that a C++ style comment was added on the end of the line, but since net.c is a C file, the Sun Forte compiler did not understand that it was a comment.

After changing the comment to a C-style /* */ comment, the error was gone.

How to repeat:
The error occurs every time I try to compile using Sun's Forte compiler.

Suggested fix:
Change the comment from "// blah" to "/* blah */".
[20 Feb 2004 12:25] Jeremy Baumgartner
Sorry, not sure what I was thinking when I entered the file and line number in the original bug report.  They're wrong.

The real file and line number are:

sql/net_serv.cc, line 836

However, they are symlinked to libmysql/net.c, thus when using a C compiler that doesn't understand that // and /* */ are comments, it fails.
[21 Feb 2004 5:22] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

sorry for this.
we do have a similar picky compiler on AIX, but apparently this comment was fixed in 4.1 tree only, not in 4.0.

Corrected.