Commit f5f01b15 authored by unknown's avatar unknown
Browse files

Fixed compiler warnings from gcc 4.0.2:

- Added empty constructors and virtual destructors to many classes and structs
- Removed some usage of the offsetof() macro to instead use C++ class pointers


configure.in:
  Added comment
ndb/include/ndbapi/NdbDictionary.hpp:
  Fixed compiler warnings from gcc 4.0.2
sql/field.cc:
  Fixed compiler warnings from gcc 4.0.2
sql/handler.h:
  Fixed compiler warnings from gcc 4.0.2
sql/item.h:
  Fixed compiler warnings from gcc 4.0.2
sql/item_cmpfunc.h:
  Fixed compiler warnings from gcc 4.0.2
sql/log_event.h:
  Fixed compiler warnings from gcc 4.0.2
sql/mysql_priv.h:
  Fixed compiler warnings from gcc 4.0.2
  For find_table_in_list I fixed it to use proper C++ class pointers instead of C style pointers
sql/opt_range.cc:
  Fixed compiler warnings from gcc 4.0.2
sql/parse_file.h:
  Fixed compiler warnings from gcc 4.0.2
sql/sp_rcontext.h:
  Fixed compiler warnings from gcc 4.0.2
sql/spatial.h:
  Fixed compiler warnings from gcc 4.0.2
sql/sql_base.cc:
  Fixed compiler warnings from gcc 4.0.2
sql/sql_cache.h:
  Fixed compiler warnings from gcc 4.0.2
sql/sql_class.h:
  Fixed compiler warnings from gcc 4.0.2
sql/sql_parse.cc:
  Fixed compiler warnings from gcc 4.0.2
  (Not pretty, but seams to work...)
sql/sql_select.h:
  Fixed compiler warnings from gcc 4.0.2
sql/sql_update.cc:
  Fixed compiler warnings from gcc 4.0.2
sql/table.h:
  Fixed compiler warnings from gcc 4.0.2
sql/tztime.cc:
  Fixed compiler warnings from gcc 4.0.2
sql/tztime.h:
  Fixed compiler warnings from gcc 4.0.2
parent 635d5b73
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -356,6 +356,9 @@ then
  # mysqld requires -fno-implicit-templates.
  # Disable exceptions as they seams to create problems with gcc and threads.
  # mysqld doesn't use run-time-type-checking, so we disable it.
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
  # regarding offset() usage in C++ which are done in a safe manner in the
  # server
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
    [1], [Defined by configure. Use explicit template instantiation.])
+3 −0
Original line number Diff line number Diff line
@@ -61,12 +61,15 @@ typedef struct charset_info_st CHARSET_INFO;
 */
class NdbDictionary {
public:
  NdbDictionary() {}                          /* Remove gcc warning */
  /**
   * @class Object
   * @brief Meta information about a database object (a table, index, etc)
   */
  class Object {
  public:
    Object() {}                               /* Remove gcc warning */
    virtual ~Object() {}                      /* Remove gcc warning */
    /**
     * Status of object
     */
+1 −1
Original line number Diff line number Diff line
@@ -5262,7 +5262,7 @@ int Field_date::store(longlong nr, bool unsigned_val)
  }

  if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
    nr=floor(nr/1000000.0);			// Timestamp to date
    nr= (longlong) floor(nr/1000000.0);         // Timestamp to date

  if (error)
    set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
+2 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ struct xid_t {
  long bqual_length;
  char data[XIDDATASIZE];  // not \0-terminated !

  xid_t() {}                                /* Remove gcc warning */  
  bool eq(struct xid_t *xid)
  { return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
  bool eq(long g, long b, const char *d)
@@ -463,6 +464,7 @@ typedef class Item COND;

typedef struct st_ha_check_opt
{
  st_ha_check_opt() {}                        /* Remove gcc warning */
  ulong sort_buffer_size;
  uint flags;       /* isam layer flags (e.g. for myisamchk) */
  uint sql_flags;   /* sql layer flags - for something myisamchk cannot do */
+4 −1
Original line number Diff line number Diff line
@@ -164,7 +164,8 @@ struct Hybrid_type_traits
  virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const;
  virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const;
  static const Hybrid_type_traits *instance();
  Hybrid_type_traits() {};
  Hybrid_type_traits() {}
  virtual ~Hybrid_type_traits() {}
};


@@ -339,6 +340,7 @@ class Name_resolution_context_state
  bool        save_resolve_in_select_list;

public:
  Name_resolution_context_state() {}          /* Remove gcc warning */
  TABLE_LIST *save_next_local;

public:
@@ -1015,6 +1017,7 @@ bool agg_item_charsets(DTCollation &c, const char *name,
class Item_num: public Item
{
public:
  Item_num() {}                               /* Remove gcc warning */
  virtual Item_num *neg()= 0;
  Item *safe_charset_converter(CHARSET_INFO *tocs);
};
Loading